The TABLE function returns the data from a CSV or Properties file associated with the specified key.
The input is the key to search for in the specified file.
Each record in a CSV file takes the form of "key,value". Each record in a Properties file takes the form of "key=value".
Input | Data Type | Description |
---|---|---|
Input1 | String | The key. |
Output | Data Type | Description |
---|---|---|
Output1 | String | The data associated with the specified key. |
Name | Property Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Mode | choice |
Specifies whether the input table is to the read from a file or to be defined by the InlineTable property.
|
|||||||||||||||||||||
Type | choice |
Specifies the table's format.
|
|||||||||||||||||||||
FilePath | String |
If Mode=File, this property specifies the file to read the table data from. If the file is specified using a relative path, then the base directory is the project owner's home directory. |
|||||||||||||||||||||
FileEncoding | choice | If Mode=File, this property specifies the table file's character encoding.
|
|||||||||||||||||||||
InlineTable | String |
If Mode=Inline, this property specifies the table's data. |
|||||||||||||||||||||
KeyColumn | int |
If Type=CSV, this property specifies which field in the table's records are to be used as the key field. A record's first field is indexed as 1. |
|||||||||||||||||||||
ValueColumn | int |
If Type=CSV, this property specifies which field in the table's records are to be used as the value field. A record's first field is indexed as 1. |
|||||||||||||||||||||
IllegalKey | choice | Defines what is to be output if no data exists for the specified key.
|
|||||||||||||||||||||
DefaultValue | String |
The default value to be output when |
Property | Output | |||
Input 1 | D002 | Mode | File | MN345 |
Type | CSV | |||
FilePath | ../table.csv | |||
FileEncoding | (AutoDetect) | |||
KeyColumn | 1 | |||
ValueColumn | 2 | |||
IllegalKey | Key |
The ../table.csv file's content used in the example above is listed below:
D001,MN123
D002,MN345
D003,MN567
D004,MN789