Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Downloading excel file using shell script

 
Rashmee Kulkarni
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there are Windows versions of curl and wget that should be able to do this.
 
Rashmee Kulkarni
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
I have tried to use wget but getting same problem..
 
Rashmee Kulkarni
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I used binary mode of FTP to transfer file to windows..
and it worked
 
Craig Jackson
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic