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/Output

Number of Connections: Min: 1/Max:Unlimited
InputData TypeDescription
InputNStringThe key.

OutputData TypeDescription
OutputNStringThe data associated with the specified key.

Property

NameProperty TypeDescription
ModechoiceSpecifies 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 InlineTable.
TypechoiceSpecifies the table's format.
CSV [CSV] - CSV format. Specifies the column for the key and the value in KeyColumn and ValueColumn.
key=value [key=value] - Each record in the table will take the form of "key=value".
HomeDirectorypathResolverSpecify the base folder of relative path of table file.
Project folder [Relative]
Start point is the same folder as the project file.
Home folder [ProjectOwner]
Start point is the projedct owner's home folder.
Executing user home folder [ExecuteUser]
Start point is the execute user's home folder.
FilePathremoteFile 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.

KeyColumnstring

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

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 [Null]
An empty String ("") is output.
Key [Key]
The input key is passed directly as output.
DefaultValue [DefaultValue]
The DefaultValue is output. If Type is "CSV" and the multiple value columns are defined, all value of columns are set to DefaultValue.
Exception [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

Example2

Property
Input1D002ModeFileOutput1MN345
Input2BTypeCSVOutput2JKL
FilePath../multitable.csv
FileEncoding(AutoDetect)
KeyColumn1,2
ValueColumn3,4
IllegalKeyKey

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

D001,A,MN123,ABC

D001,B,MN123,DEF

D002,A,MN345,GHI

D002,B,MN345,JKL

D003,A,MN567,PQR

D003,B,MN567,STU