tlcol: List column information for a table.

Package: nttools

Usage

tlcol table

Description

This task is used to list column information for a table. The output is written to STDOUT, which may be redirected to a file. There will be one line of output for each column in the table, and each output line may contain the column name, data type, print format, and units. The first line of output for each table in the input list is the table name preceded by a # sign.

The output from this task may be used as input to various tasks such as 'tcreate', 'tprint', and 'tproject'.

Parameters

table [file name template]
A list of tables for which column info is to be printed.
(nlist = 4) [integer, min=1, max=4]
The number of items to list. The output will consist of 'nlist' columns, one line for each column that is defined in the table. The items listed out are column name (displayed for all 'nlist' values), data type (displayed if 'nlist' is 2 or higher), display format (if 'nlist' is 3 or higher), units (if 'nlist' is 4). If 'nlist = 1', only the column name will be displayed; the output list may be edited and used as input to 'tprint', 'tdump,' 'tedit', 'tread', 'tproject', or 'tquery'. The default of 4 can be used to generate a column-description file for the 'tcreate' task. If a column contains an array of values at each row, rather than just a single element, the array size is shown in square brackets appended to the data type.

Examples

1. Display the names, data types, print formats, and units of all the columns in the table "example.tab":

tt> tlcol example.tab

2. Print (using the 'tprint' task) specific columns:

        tt> tlcol example.tab nlist=1 >colnames.lis
        tt> edit colnames.lis
        (Rearrange the column names and perhaps delete some of them.)
        tt> tprint example.tab columns=@colnames.lis

3.  Create a new table based on the columns in "example.tab":

        tt> tlcol example.tab nlist=4 >colnames.lis
        tt> edit colnames.lis
        (Delete or modify some column descriptions and/or add new ones.)
        tt> tcreate ex2.tab cdfile=colnames.lis ...

Bugs

References

This task was written by Phil Hodge.

See also

tinfo, tcreate, tdump