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 lines, use tablines(1NEMO) or tabmath(1NEMO) .


The following parameters are recognized in any order if the keyword is also given:
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. [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.


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

tablines(1NEMO) , tabmath(1NEMO) , tabs(1NEMO) , awk(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

Table of Contents