file-read-line2.0

file-read-line

Reads the next line in the file and reports it as a string. It determines the end of the file by a carriage return, an end of file character or both in a row. It does not return the line terminator characters.

Also note that the file-open command must be called before this reporter can be used, and there must be data remaining in the file. Use the reporter file-at-end? to determine if you are at the end of the file.

file-open "my-file.txt"
print file-read-line
=> Hello World

See also file-open.

Take me to the full NetLogo Dictionary