If you do not want all this in memory, you can do:
String readLine( File f, int n ) {
String line = null
f.withReader { r ->
while( n-- > 0 && ( ( line = r.readLine() ) != null ) ) ;
}
line
}
Then, to print the 5th line:
File infile = new File("C:\\Documents and Settings\\ABCEDFG\\Desktop\\soapUI\\params.txt")
String line = readLine( infile, 5 )
println line
, , , . , , ,