TSTool / Command / DeleteTableColumns
Overview
The DeleteTableColumns deletes specified columns from a table.
The list of column names to delete is is determined from the DeleteColumns parameter,
except that any columns specified by the KeepColumns are not deleted.
Command Editor
The following dialog is used to edit the command and illustrates the syntax of the command.
DeleteTableColumns Command Editor (see also the full-size image)
Command Syntax
The command syntax is as follows:
DeleteTableColumns(Parameter="Value",...)
Command Parameters
| Parameter | Description | Default |
|---|---|---|
TableIDrequired |
The table identifier for the table to process. Can specify with ${Property}. |
None - must be specified. |
KeepColumnsrequired |
The names of columns to keep, separated by commas. Can use ${Property} to specify column names. Each column name can also contain * wildcard. |
None - must be specified. |
DeleteColumnsrequired |
The names of columns to delete, separated by commas. Can use ${Property} to specify column names. Each column name can also contain * wildcard. |
None - must be specified. |
Examples
See the automated tests.
A simple comma-separated-value data as follows can be read with ReadTableFromDelimitedFile:
# Simple table for testing
"string1","double1","integer1"
"String1",1.0,1
"String2",2.0,2
"String3",3.0,3
The command file to read the above file and remove the first and last two columns is as follows:
ReadTableFromDelimitedFile(TableID="Table1",InputFile="testtable.csv")
DeleteTableColumns(TableID="Table1",DeleteColumns="double1,integer1")
Troubleshooting
See Also
DeleteTableRowscommandReadTableFromDelimitedFilecommandRenameTableColumnscommand