Read a file line by line: Difference between revisions

Added Frink
(Added Frink)
Line 345:
2drop
repeat ;</lang>
 
=={{header|Frink}}==
The lines function can also take an optional second string argument indicating the encoding of the file, and can read from any supported URL type (HTTP, FTP, etc.)
<lang frink>
for line = lines["file:yourfile.txt"]
println[line]
</lang>
 
=={{header|Go}}==
The latest way to do this (as of May 2011) with Go's rapidly evolving library is bufio.ReadLine. This function, demonstrated here, allows files to be very rapidly scanned for desired data with no superfluous memory allocations or garbage being generated.
Anonymous user