[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what is the use of -c parameter of column(1), can you demonstrate with an example?



 On 11/02/2010 08:01 PM, Chris Jackson wrote:
> -c is for the total number of columns. Having said that, I can't get it
> to actually do anything, so I could be wrong.
>
> You could perhaps use awk:
>
> http://unstableme.blogspot.com/2008/12/awk-formatting-fields-into-columns.html
>
> (bit fugly) or, depending on exactly what you need, look at pr(1).

Can someone dealt with gnu before tell if gnu utilities too bureaucratic
to accept any change? If they still can accept some change, I would like
to request an update the man page (I wouldn't file a bug just to wait
for it to sink in some decades).

It says:

     The column utility formats its input into multiple columns.  Rows are
     filled before columns.  Input is taken from file operands, or, by
     default, from the standard input.  Empty lines are ignored.

     The options are as follows:

     -c      Output is formatted for a display columns wide.

     -t      Determine the number of columns the input contains and create a
             table.  Columns are delimited with whitespace, by default, or
             with the characters supplied using the -s option.  Useful for
             pretty-printing displays.


This man page have 2 problems. First:



    The first paragraph's mentioning of 'column' obviously means
    something different than the '-c' paragraph's mentioning of 'column'.

    In the first paragraph it means what we usually mean column in
    typography, like on daily newspaper: one or more vertical blocks of
    text positioned on a page, usually wraps at 3 to 10 words per line.

    The '-c' paragraph it means what column means in man stty(1).

Second problem:

    The usage with -t is to form a table, which, although code level
    implementation is similar to multi-column layout, in fact is a very
    different usage than what is mentioned in the first paragraph.

A less confusing version from a non-English speaker would be to change
it to:

    The column utility formats its input into a multi-column layout or
    to a table. By default it forms a multi-column layout, taking the
    input, filling rows before columns. With -t it forms a table,
    expanding the field separator to align table columns.

    The options are as follows:


    -c columns

        Output is formatted for a terminal that has that number of
        columns. Default is the current terminal's column number. Refer
        to stty(1) for more info about terminal columns. A character is
        as wide as one or two columns of a terminal.

    -t

        Create a table instead of making a multi-column layout. Columns
        are delimited with whitespace, by default, or with the
        characters supplied using the -s option. Useful for
        pretty-printing tabular data.




Reply to: