.Modelica.Utilities.Streams.readFile

Information

Syntax

stringVector = Streams.readFile(fileName)

Description

Function readFile(..) opens the given file, reads the complete content, closes the file and returns the content as a vector of strings. Lines are separated by LF or CR-LF; the returned strings do not contain the line separators. Note, a fileName can be defined as URI by using the helper function loadResource.

Interface

impure function readFile
  extends Modelica.Icons.Function;
  input String fileName "Name of the file that shall be read" annotation(
    Dialog(loadSelector(filter = "Text files (*.txt)", caption = "Open text file for reading")));
  output String stringVector[countLines(fileName)] "Content of file";
end readFile;

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f