column - select columns from an rdbtable
column [options] arguments
The argument list may contain column names, standalone options, doublets of the form option arg and triplets of the form option arg1 arg2.
Isolated column names indicate that those columns are slated either for deletion or retention, depending upon whether the -v or -V option has been specified. By default the specified columns are slated for retention.
The standalone options are:
Doublet options have the following forms:
column foo -R 'boo*'
For example, if the input table has the following column list:
xB xD xC xA cE cA cD cB cX
column -s '^x' -s '^c'
will result in an order of
xA xB xC xD cA cB cD cE cX
The triplet options have the following forms:
-, a definition will be composed of - characters,
the same number of characters as are in name.
-C 'K(.*)F' 'Q$1'
would change 'KuuF' to 'Quu'
-D 'K(.*)F' 'Q$1'
duplicates 'KuuF' as 'Quu'
This RDB operator reads an rdbtable from STDIN and writes an rdbtable to STDOUT. Options may be abbreviated.
It selects columns by name (and order) and outputs an rdbtable with these columns. It effectively select, order, add, delete, or duplicate columns.
As an example to select columns named 'NAME' and 'COUNT' the command would be:
column NAME COUNT < sample
To select all columns except column 'NAME' the command would be:
column -v NAME < sample
To add a new column named 'LENGTH' with a size of 10 the command would be:
column -v -a LENGTH 10 < sample
Note that to include documentation with the new column definition the command would be:
column -v -a LENGTH '10 length in meters' < sample
The '10 length in meters' must be quoted so that it will be treated as a single token.
Original by Walter V. Hobbs
Rewritten and extended by Diab Jerius ( djerius@cfa.harvard.edu ).