This HTML automatically generated with rman for NEMO
Table of Contents


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


tabcols [parameter=value] ...


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.


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.
input file name(s). No default.
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]
Column separator. Valid are: s (space), n (newline), t (tab), r (carriage return), as well as the literal symbols ’,’ and ’:’. [Default: s]
output file name. By default standard output it used.


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


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

See Also

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


src/kernel/tab/tabcols.c source code


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