Anonymous user
Read a specific line from a file: Difference between revisions
Read a specific line from a file (view source)
Revision as of 15:35, 18 February 2012
, 12 years ago→{{header|Groovy}}
No edit summary |
|||
Line 349:
=={{header|Groovy}}==
<lang groovy>def line = null
new File("lines.txt").eachLine { currentLine, lineNumber ->
if (lineNumber == 7) {
Line 356 ⟶ 355:
}
}
println "Line 7 = $line"</lang>
=={{header|Icon}} and {{header|Unicon}}==
|