This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Downloading excel file using shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Downloading excel file using shell script" Watch "Downloading excel file using shell script" New topic
Author

Downloading excel file using shell script

Rashmee Kulkarni
Greenhorn

Joined: Mar 27, 2010
Posts: 21
Hi..
I want to download excel file from one website using shell script and save it.
Right now I am using following command and file is getting downloaded.

lynx -source http://www.xyz.com/example.xls > example.xls
(not the actual site...used as example)

But if I transfer the file on windows and try to view the contents I am getting "Excel has unreadable data" message
and even if after recovering it not getting the data.

Please help...
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
I think there are Windows versions of curl and wget that should be able to do this.
Rashmee Kulkarni
Greenhorn

Joined: Mar 27, 2010
Posts: 21
Hi Ulf,
I have tried to use wget but getting same problem..
Rashmee Kulkarni
Greenhorn

Joined: Mar 27, 2010
Posts: 21
Hi All,
I used binary mode of FTP to transfer file to windows..
and it worked
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Yes.

You should use binary mode, otherwise when you transfer the file to a windows environment, there is good possibly carriage returns<cr> will be added to the contents of the file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Downloading excel file using shell script
 
It's not a secret anymore!