TABLE

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

Number of Connections: 1
InputData TypeDescription
Input1StringThe key.

Output

OutputData TypeDescription
Output1StringThe data associated with the specified key.

Property

NameProperty TypeDescription
Modechoice Specifies whether the input table is to the read from a file or to be defined by the InlineTable property.

File - Read the table data from a file.

Inline - Receive the table data from the input stream.
Typechoice Specifies the table's format.


CSV - CSV format
key=value - Each record in the table will take the form of "key=value".
FilePathString

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.

FileEncodingchoiceIf Mode=File, this property specifies the table file's character encoding.


(AutoDetect) - Attempts to automatically detect and select the character code.
utf-8 - Unicode utf-8
shift_jis - Shift JIS
euc-jp - EUC-JP
iso-2022-jp - ISO-2022-JP
Windows-31J - Windows Japanese
utf-16 - Unicode utf-16
InlineTableString

If Mode=Inline, this property specifies the table's data.

KeyColumnint

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.
ValueColumnint

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.
IllegalKeychoiceDefines what is to be output if no data exists for the specified key.


Null - An empty String ("") is output.
Key - The input key is passed directly as output.
DefaultValue - The DefaultValue is output.
Exception - An Exception is thrown.
DefaultValueString

The default value to be output when IllegalKey is set to DefaultValue and no matching key field is found.


Topic


Example

PropertyOutput
Input 1D002ModeFileMN345
TypeCSV
FilePath../table.csv
FileEncoding(AutoDetect)
KeyColumn1
ValueColumn2
IllegalKeyKey

The ../table.csv file's content used in the example above is listed below:

D001,MN123

D002,MN345

D003,MN567

D004,MN789