Read file line by line using groovy script. def file = new File('sampleFile.txt') file.eachLine { line -> println line }
SampleFile.txt
this is sample file
this is second line
end of file
Output
this is sample file
this is second line
end of file