functionreadStringCSV

Read real matrix from CSV file

Extends from Modelica.Icons.Function (Icon for functions).

Information

This functions reads an array from a CSV file and returns a matrix of equal size. The array size of the CSV file is specified by the integers

  • rowBegin and rowEnd,
  • colBegin and colEnd.


File format

  • Recommended delimiters are
    • "\t" tab
    • " " space
    • "," comma
  • The decimal separator must be .

Inputs

TypeNameDefaultDescription
StringfileNameCSV file name
IntegerrowBegin1First row of CSV array
IntegerrowEndrowBeginEnd row of CSV array
IntegercolBegin1First column of CSV array
IntegercolEndcolBeginEnd column of CSV array
Stringdelimiter"\t"Delimiter of CSV file
BooleanuseQuotedStringsfalseUse quoted strings, if true
BooleancachefalseRead file before compiling, if true

Outputs

TypeNameDefaultDescription
String[rowEnd - rowBegin + 1,colEnd - colBegin + 1]matrixMatrix read from CSV file