How to read data line by line from a file using ant script? -


In Perl, we read & lt; FileDescriptor & gt; How to do the same way using ant script.

You can use the task in combination with the job (you have to download ant-copy and install Must do).

  & lt; Project name = "test" default = "compilation" & gt; & Lt; Workflow resource = "net / sf / extract / antacrobb properties" & gt; & Lt; Classpath & gt; & Lt; Pathelement location = "path / to / ant-contrib.jar" /> & Lt; / Classpath & gt; & Lt; / Taskdef> & Lt; LoadFile Property = "File" srcfile = "somefile.txt" /> & Lt; Target name = "compilation" & gt; Param = "line" list = "$ {file}" delimiter = "$ {line.separator}" & gt; For & lt; & Lt; Sequential & gt; & Lt; Echo & gt; @ {Line} & lt; / Echo & gt; & Lt; / Sequential & gt; & Lt; For / & gt; & Lt; / Target & gt; & Lt; / Project & gt;    

Comments