NetLogo Help: file-read-characters

### file-read-characters2.0

#### file-read-characters number

Reports the given number of characters from an opened file as a string. If there are fewer than that many characters left, it will report all of the remaining characters.

Note that it will return every character including newlines and spaces.

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-characters 5
    ;; Current line in file is "Hello World"
    => Hello

See also file-open.

Take me to the full NetLogo Dictionary