Skip to Content
FASTSUITE E2API ReferencePython APIAPI DomainsOperatorsCsv Parser Operator

Csv Parser Operator

Quick Facts

PropertyValue
ClassCENPyOlpCsvParserOperator
Modulecenpylib.CENPyOlpCsvParserOperator
Packagecenpylib
ReleaseR2025.2.4
Methods7

Quick Start

# Boilerplate Example csvParserOperator = ... # obtained from the runtime context result = csvParserOperator.GetNumberOfRows()

Method Index

MethodReturnsSummary
LoadCsvFileintThis functions loads the csv-File.
GetNumberOfRowsintGet the number of rows of the csv file, if a file was loaded successfully.
GetNumberOfColumnsintGet the number of columns of the loaded csv file.
GetCellstrAccessing a cell by an integer.
GetCellByColumnNamestrAccessing a cell by column-name(e.g.
SetSeparatorSetting the separator-character in the csv-file.
GetRowlistGets the row at the given, zero-based index.

Query Methods

LoadCsvFile

def LoadCsvFile(filepath: str) -> int

This functions loads the csv-File. After that, you can access the different cells.

Parameters:

NameTypeDescription
filepathstrFile path with ending ‘.csv’.

Returns: int — ERR_NO_ERROR (0) on success, an error code otherwise.

GetNumberOfRows

def GetNumberOfRows() -> int

Get the number of rows of the csv file, if a file was loaded successfully. If called after an unsuccessful load, returns an unspecified value.

Returns: int — The number of rows of the file.

GetNumberOfColumns

def GetNumberOfColumns() -> int

Get the number of columns of the loaded csv file. If called after an unsuccessful load, returns an unspecified value.

Returns: int — The number of columns of the file.

GetCell

def GetCell(columnIndex: int, rowIndex: int) -> str

Accessing a cell by an integer. Remark: Accessing the first cell by column = row = 1.

Parameters:

NameTypeDescription
columnIndexintThe column-index.
rowIndexintThe row-index.

Returns: str — ERR_NO_ERROR (0) on success, an error code otherwise.

GetCellByColumnName

def GetCellByColumnName(columnName: str, rowIndex: int) -> str

Accessing a cell by column-name(e.g. A, B, .., AA, AB,..) and a row-index. Remark: Accessing the first cell by column = A, row = 1.

Parameters:

NameTypeDescription
columnNamestrThe column-name.
rowIndexintThe row-index.

Returns: str — ERR_NO_ERROR (0) on success, an error code otherwise.

GetRow

def GetRow(rowIndex: int) -> list

Gets the row at the given, zero-based index.

Parameters:

NameTypeDescription
rowIndexintRow index.

Returns: list — ERR_NO_ERROR (0) on success, an error code otherwise.

Mutation Methods

SetSeparator

def SetSeparator(separator: str)

Setting the separator-character in the csv-file. Remark: The default separator is ’;’.

Parameters:

NameTypeDescription
separatorstrThe separator-character.

Version Notes

This class is documented as of release R2025.2.4.

Was this page helpful?