Csv Parser Operator
Quick Facts
| Property | Value |
|---|---|
| Class | CENPyOlpCsvParserOperator |
| Module | cenpylib.CENPyOlpCsvParserOperator |
| Package | cenpylib |
| Release | R2025.2.4 |
| Methods | 7 |
Quick Start
# Boilerplate Example
csvParserOperator = ... # obtained from the runtime context
result = csvParserOperator.GetNumberOfRows()Method Index
| Method | Returns | Summary |
|---|---|---|
LoadCsvFile | int | This functions loads the csv-File. |
GetNumberOfRows | int | Get the number of rows of the csv file, if a file was loaded successfully. |
GetNumberOfColumns | int | Get the number of columns of the loaded csv file. |
GetCell | str | Accessing a cell by an integer. |
GetCellByColumnName | str | Accessing a cell by column-name(e.g. |
SetSeparator | — | Setting the separator-character in the csv-file. |
GetRow | list | Gets the row at the given, zero-based index. |
Query Methods
LoadCsvFile
def LoadCsvFile(filepath: str) -> intThis functions loads the csv-File. After that, you can access the different cells.
Parameters:
| Name | Type | Description |
|---|---|---|
filepath | str | File path with ending ‘.csv’. |
Returns: int — ERR_NO_ERROR (0) on success, an error code otherwise.
GetNumberOfRows
def GetNumberOfRows() -> intGet 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() -> intGet 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) -> strAccessing a cell by an integer. Remark: Accessing the first cell by column = row = 1.
Parameters:
| Name | Type | Description |
|---|---|---|
columnIndex | int | The column-index. |
rowIndex | int | The row-index. |
Returns: str — ERR_NO_ERROR (0) on success, an error code otherwise.
GetCellByColumnName
def GetCellByColumnName(columnName: str, rowIndex: int) -> strAccessing 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:
| Name | Type | Description |
|---|---|---|
columnName | str | The column-name. |
rowIndex | int | The row-index. |
Returns: str — ERR_NO_ERROR (0) on success, an error code otherwise.
GetRow
def GetRow(rowIndex: int) -> listGets the row at the given, zero-based index.
Parameters:
| Name | Type | Description |
|---|---|---|
rowIndex | int | Row 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:
| Name | Type | Description |
|---|---|---|
separator | str | The separator-character. |
Version Notes
This class is documented as of release R2025.2.4.