This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 19
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
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
I think there are Windows versions of curl and wget that should be able to do this.


Ping & DNS - my free Android networking tools app
Rashmee Kulkarni
Greenhorn

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

Joined: Mar 27, 2010
Posts: 19
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