WOLFRAM SYSTEM MODELER
readLineRead a line of text from a file and return it in a string |
SystemModel["Modelica.Utilities.Streams.readLine"]
This information is part of the Modelica Standard Library maintained by the Modelica Association.
(string, endOfFile) = Streams.readLine(fileName, lineNumber)
Function readLine(..) opens the given file, reads enough of the content to get the requested line, and returns the line as a string. Lines are separated by LF or CR-LF; the returned string does not contain the line separator. The file might remain open after the call.
If lineNumber > countLines(fileName), an empty string is returned and endOfFile=true. Otherwise endOfFile=false.
fileName |
Type: String Description: Name of the file that shall be read |
---|---|
lineNumber |
Type: Integer Description: Number of line to read |
string |
Type: String Description: Line of text |
---|---|
endOfFile |
Type: Boolean Description: If true, end-of-file was reached when trying to read line |