*tablepopulate

Populates a table with data from a delimited file.

Syntax

*tablepopulate name filename delimiter

Type

HyperMesh Tcl Modify Command

Description

Populates an existing table with data from a delimited file. The data in the file must match the format of the columns defined in the table. Additional rows are appended to the table and existing data remains.

Inputs

name
The name of the table to populate. The table will be overwritten with the data from the file.
filename
The full path and filename of the file to use to populate the table.
delimiter
The character or string to use as the delimiter. The value must be enclosed in quotes. If not specified, the default is a comma (CSV).

Examples

To populate table1 with C:/table1.csv, which is a comma delimited file:

*tablepopulate table1 C:/table1.csv ","

or

*tablepopulate table1 C:/table1.csv

To populate table1 with C:/table1.txt, which is a space delimited file:

*tablepopulate table1 C:/table1.txt " "

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

11.0