Skip to main content
Version: 0.5.0

TableInterpreter

Input type: Sheet

Output type: Table

Description

Interprets a Sheet as a Table. In case a header row is present in the sheet, its names can be matched with the provided column names. Otherwise, the provided column names are assigned in order.

Example 1

 block CarsTableInterpreter oftype TableInterpreter {
header: true;
columns: [
"name" oftype text,
"mpg" oftype decimal,
"cyl" oftype integer,
];
}

Interprets a Sheet about cars with a topmost header row and interprets it as a Table by assigning a primitive value type to each column. The column names are matched to the header, so the order of the type assignments does not matter.

Example 2

 block CarsTableInterpreter oftype TableInterpreter {
header: false;
columns: [
"name" oftype text,
"mpg" oftype decimal,
"cyl" oftype integer,
];
}

Interprets a Sheet about cars without a topmost header row and interprets it as a Table by sequentially assigning a name and a primitive value type to each column of the sheet. Note that the order of columns matters here. The first column (column A) will be named "name", the second column (column B) will be named "mpg" etc.

Properties

Type boolean

Default: true

Description

Whether the first row should be interpreted as header row.

columns

Type Collection<ValuetypeAssignment>

Description

Collection of value type assignments. Uses column names (potentially matched with the header or by sequence depending on the header property) to assign a primitive value type to each column.