File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scripting help needed!

 
Gopu Akraju
Ranch Hand
Posts: 242
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not done any scrpting before. Thanks.

I am using wget to download contents as below:



I want to do this programatically. For example, I have a list of id in a text file as below:

list.txt

----------
23456
78910
..
..
.
.
-----------

How do I programatically open this list.txt and use wget command? Thanks.
Regards

[ UD: fixed CODE tags ]
[ July 09, 2008: Message edited by: Ulf Dittmer ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11833
181
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I strongly recommend you look at the following 2 options in wget:

Using these is much more friendly than just hammering the server as you try to download 'x' number of files.

As for your actual question - you might want to consider concatenating the file to standard out, piping that through the shell's read command to store it in a variable, then using that. Viz:

Can you see how to use this in your case?

Regards, Andrew
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic