[Previous] [Next] [Up] [Top] [Edit]

NAME

column - project columns from a starbase data table

SYNOPSYS

column  [-i input] [-o output] [options] [column] ...
project [-i input] [-o output] [options] [column] ...

DESCRIPTION

column is used to create, delete, format and choose columns in a table.

column reads a starbase data table from its standard input and prints a table with the columns given as arguments on its standard output. If a given column does not exist it is created in the output. If no column are given as arguments all the columns in the table are output.

column and project are the same program.

OPTIONS

Program Options

Justification Options

The use of any justification flags implies that all the columns will be justified. Justification options that are listed on the command line apply to all following columns until a different option is given. Options that are suffixed to a column name with ":" only apply to that column. The default justification is left for text and right for numbers. The output width of a column may be controlled by appending a width for the column in characters to a column name with a ",". A column can be reformatted by appending a sprintf format spec to the columns name with a "%".

Some examples of justification options with justify. Other column programs also support these options:

Justify the table:
    john@panic : justify < foo
    X       Name            Y      
    ------  --------        -------
       4.5  Star1           5000   
     435    Star2_bk           4.3 
    2300    Star3              2.04

Justify all the column, override the default left for text:
    john@panic : justify < foo -a -r Name
        Name        X       Y      
    --------        ------  -------
       Star1           4.5  5000   
    Star2_bk         435       4.3 
       Star3        2300       2.04

Do the same thing with an appended column option:

    john@panic : justify < foo -a Name:r
        Name        X       Y
    --------        ------  -------
       Star1           4.5  5000
    Star2_bk         435       4.3
       Star3        2300       2.04

Sepcify a column width for the name column:

    john@panic : justify Name,20 < foo
    Name                
    --------------------
    Star1               
    Star2_bk            
    Star3               

Formatting Options

Column will accept column formatting options to reformat the ASCII representation of numeric columns. These options are invoked by following the column name with a printf style % specification.

Format some columns:
 john@panic : column X%7.2f Y%7.2f RA%12.3@ Dec%11.2@
 X       Y       RA      Dec
 -       -       --      ---
 512.00  512.00           12:30:34.501           34:00:54.45

EXAMPLES

Ask for all the column from the standard input

    john@panic: column <  input
    X       Y
    -       -
    0       1
    0       1

Ask for all the columns from a file specified with the -i switch put the output in a file specified with the -o switch.

    john@panic: column -i input -o output

Ask for the X column

    john@panic: column X < input
    X
    -
    0
    0

Number the rows

    john@panic: column -n < input
    Number  X       Y
    ------  -       -
    1       0       1
    2       0       1
    3       0       1

Rename a column.

    john@panic: column X=K < input
    K       Y
    -       -
    0       1
    0       1
    0       1

Output only the header without the rows

    john@panic: $ column -h < input
    Value Table

    X1      1
    Y1      1       2       3

    X       Y
    -       -

Output the rows wo/ the header.

    john@panic: $ column -b < input
    0       1
    1       2

Output the extended header part.

    john@panic: column -hv < input
    Value Table

    X1      1
    Y1      1       2       3

Output the header values as a value table

    john@panic: $ column -hV < val $
    Name    Value
    ----    -----
    X1      1
    Y1      1       2       3

Output the headline or the dashline.

    john@panic: $ column -hl < input
    X       Y
    john@panic: $ column -hd < input
    -       -

Add a column to the table using the -a all/add option.

    john@panic: $ column -a Z < input
    Z       X       Y
    -       -       -
            0       1
            0       1
            0       1

Justify one column with the default justifications pass the others through.

    john@panic: $ column AAAAAA:d B C D E < U.tab $
    AAAAAA  B       C       D       E
    ------  -       -       -       -
    1.00    112.00  3       4.00    5
    1      1113    4.00    5.0     6
    1      1113    4.00    5.0     6

Justify all column by default but pass one column through using the column :p flag.

    john@panic: $ column -d AAAAAA B C:p D E < U.tab $
    AAAAAA  B       C       D       E
    ------  ------- -       ------- -
      1.00   112.00 3          4.00 5
      1     1113    4.00       5.0  6

Column Name Pattern Selection and Renaming

Columns can be selected by explicit name or by pattern matching. This can be effectivly used to select columns that have similar prefix or suffix charateers. Column name patterns use the same file selection meta chatacters that are used by the shell (*?[]). When selecting column for renaming (with the = option) the "matched" part of the column name can be used in the new name with the '?' character.

Examples

After a search -j operation, select all of the column from the keytable:

    john@panic: column '*_1' < search_results

On the same table rename the columns back to thier original names:

    john@panic: column '*_1=?' < search_results

SEE ALSO



[Previous] [Next] [Up] [Top] [Edit]