Read (loop through) content of a file with Ant
5 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stefan_Geelen
Posted On:   Tuesday, June 15, 2004 07:28 AM

Hi,


I need to have a taks whic can read the content of a simple file. The file is generated by a SQL Task and after that I need to read the content of the file (which contains the filenames of .zip files to generate).


Example content:

filename1

filename2

filename3

...


I suppose I need to use a task, but how do I exactly read the line line per line and pass the filename to another task (which can then generate a .zip file).


Regards,


Stefan

Re: Read (loop through) content of a file with Ant

Posted By:   Anonymous  
Posted On:   Thursday, September 16, 2004 03:45 AM

Mmh line.separator works for me:







working on "@{file}"




Re: Read (loop through) content of a file with Ant

Posted By:   Anonymous  
Posted On:   Tuesday, September 14, 2004 10:00 AM

One thing that u can try is to split the SQL sentence and get each filename as a result of a query in a file as "output".
For each of this file u can use the 'LoadFile' task to get the names in a property and then use this properties to generate the Zip files names.

I.e:
classpath="${driver.path}"
driver="${driver}"
url="${url}"
userid="${db.user}"
password="${db.pwd}"
print="true"
showheaders="false"
output="${dest}"

>
YOUR SQL STATEMENT !!

]]>





basedir="C:lib"
update="true"
/>

Re: Read (loop through) content of a file with Ant

Posted By:   dhinakaran_jani  
Posted On:   Thursday, August 19, 2004 04:29 AM

Above mentioned answer will not work.I have already tried out.

Re: Read (loop through) content of a file with Ant

Posted By:   Murali_Velagapudi  
Posted On:   Monday, August 9, 2004 08:13 AM

Stefan,

I too got the same requirement of reading line by line from another file which has list of file names ,and pass on them to the another task dynamically could you please post the same how did you got that i am trying using foreach but could not get so far. thanks for your help
,
Murali

Re: Read (loop through) content of a file with Ant

Posted By:   Anonymous  
Posted On:   Tuesday, June 22, 2004 03:03 AM

Use ${line.separator} as delimiter.
About | Sitemap | Contact