countLines

Return the number of lines in a file

Information

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

Syntax

numberOfLines = Streams.countLines(fileName)

Description

Function countLines(..) opens the given file, reads the complete content, closes the file and returns the number of lines. Lines are separated by LF or CR-LF.

Syntax

numberOfLines = countLines(fileName)

Inputs (1)

fileName

Type: String

Description: Name of the file that shall be read

Outputs (1)

numberOfLines

Type: Integer

Description: Number of lines in file