In perl we use <FileDescriptor>
to read data line by ilne from a file. How to do the same using ant script.
You can do that using the loadfile
task in combination with the for
task from ant-contrib (you will have to download and install ant-contrib).
<project name="test" default="compile">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="path/to/ant-contrib.jar"/>
</classpath>
</taskdef>
<loadfile property="file" srcfile="somefile.txt"/>
<target name="compile">
<for param="line" list="${file}" delimiter="${line.separator}">
<sequential>
<echo>@{line}</echo>
</sequential>
</for>
</target>
</project>