This HTML automatically generated with rman for NEMO
Table of Contents

Name

tabcols - Select columns, and optionally rearrange, from a table

Synopsis

tabcols [parameter=value] ...

Description

tabcols selects columns from a file, and can also re-arrange the output column order. New column separators can be used on output. This way a newline on input can be converted into a space on output and therefore creating a file with one long column from a table with mulitple columns.

To select specific lines, use tabrows(1NEMO) or tabmath(1NEMO) .

To align a table by column, use the column(1) program with the -t option.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
in=
input file name(s). No default.
select=
list of columns to select. Any nemoinp(1NEMO) expression can be used. Columns can be repeated, and in any order. The output will be in exactly the same order as given with this keyword. First column is 1. Column 0 can also be added to the output, which is the row number (first row is 1). [all]
colsep=
Column separator. Valid are: s (space), n (newline), t (tab), r (carriage return), as well as the literal symbols ’,’ and ’:’. [Default: s]
out=-
output file name. By default standard output it used.

Caveats

Although this program uses the new table interface, there are still some internal variables that limits the column count.

Example

Here is an example of how to reverse the columns from a table with 4 columns:
    tabcols in.tab 4:1:-1 > out.tab
and here is an example that re-arranges all the numbers in a table in one long column
    tabcols in.tab all n > out.tab

See Also

tabrows(1NEMO) , tabmath(1NEMO) , tabs(1NEMO) , tabtab(1NEMO) , awk(1) , column(1)

Files

src/kernel/tab/tabcols.c source code

Author

Peter Teuben

Update History


26-Jan-00    V1.0 Created     PJT
9-apr-09    V2.0 out=- now default and last argument    PJT
5-may-2022    V2.1 converted to table V2 interface    PJT


Table of Contents