WOLFRAM SYSTEM MODELER

readFile

Read content of a file and return it in a vector of strings

Wolfram Language

In[1]:=
SystemModel["Modelica.Utilities.Streams.readFile"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

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.

Syntax

stringVector = readFile(fileName)

Inputs (1)

fileName

Type: String

Description: Name of the file that shall be read

Outputs (1)

stringVector

Type: String[countLines(fileName)]

Description: Content of file