Share this post on:

ExcelFile

Excel file returned by Excel function.

ExcelFile Properties

Name : String
Excel file name.

Sheets : Dict
Dictionary of excel sheets (name -> ExcelSheet).

ExcelSheet

One excel sheet from excel file.

ExcelSheet Properties

Name : String
Sheet name.

Columns : String[]
Array of column names (usually after FindHeader call).

Rows : Table
Values table of the sheet.

ExcelSheet Methods

FindHeader(keys?, startRow = 1, endRow = 0, percentage = 75) : ExcelSheet

Finds table header with column names.

FindHeader Parameters

keys?
Array of required column names to search for.
Can be string to search for one required column name, or null to search for any header-like row.

startRow : Integer = 1
Row index to start search from.

endRow? : Integer
Row index to stop search at (0 – to search until the end).

percentage : Integer = 75
Minimum percentage of non-empty cells for the header.

Table

Table is array of rows (TableRow[]).
Table rows can be retrieved by index, table columns can be retrieved by name.

Table Properties

$Columns : String[]
Array of column names.

Table Methods

GetColumnCount() : Integer

Column(indexOrName) : []

Returns column array by column index or by name.

Column Parameters

indexOrName

Row(startIndex, keys?) : TableRow

Returns row by index or by keys.

Row Parameters

startIndex : Integer
Row index to get if no keys provided, or start index to search by keys.

keys? : []
Keys to search by. Search is performed by key columns that were specified in FindHeader.

SelectRows(key, keys?) : Table

Returns a sub-table with only rows matching provided keys.

SelectRows Parameters

key
The 1st key to search by. Search is performed by the 1st key column that was specified in FindHeader.

keys? : []
Additional keys to search by. Search is performed by other key columns that were specified in FindHeader.

Range(start, count = -1) : Table

Returns a sub-table from specified range of rows.

Range Parameters

start : Integer
Start row of the range.

count : Integer = -1
Limit the number of rows in the range. (-1 = no limit).

FindHeader(keys?, startRow = 1, endRow = 0, percentage = 75) : Table

Finds table header with column names.

FindHeader Parameters

keys?
Array of required column names to search for.
Can be string to search for one required column name, or null to search for any header-like row.

startRow : Integer = 1
Row index to start search from.

endRow? : Integer
Row index to stop search at (0 – to search until the end).

percentage : Integer = 75
Minimum percentage of non-empty cells for the header.

WithoutEmptyRows() : Table

Returns new table without empty rows.

RemoveEmptyColumns() : Table

Removes all empty columns in the table, returns the same table.

Filter(predicate) : Table

Returns filtered sub-table with only rows for which predicate(row, index) is true.

Filter Parameters

predicate : Function

Concat(rows) : Table

Appends another table or array to the current table and returns new concatenated table.

Concat Parameters

rows
Can be Table or array of arrays (or simple array as single row).

TableRow

TableRow is array of items.
Table items can be retrieved both by index and by column name.

TableRow Properties

$Index : Integer
Real index of the row in the table.

TableRow Methods

RowToDict() : Dict

Returns row as dictionary (column -> value).

Share this post on:

Leave a Comment

Your email address will not be published. Required fields are marked *