Re: what is the use of -c parameter of column(1), can you demonstrate with an example?
On 2010-11-17 13:12:38 +0800, Zhang Weiwu, Beijing wrote:
> While I see it this way:
>
> expand --> Format tab-indented text and tab-separated tables using spaces.
> column -t --> Format tab-separated tables using spaces.
> column --> Format lists into columns.
"column -t" does much more than format tabs into spaces.
It can use a comma as a separator, for processing CSV data.
column -t -s ',' myfile.csv
It can use a space as a separator, for processing "aptitude update".
sudo aptitude update | column -t
It can use a colon as a separator, for processing "/etc/group".
column -t -s ':' /etc/group
> Pick this scenario:
>
> A user have tab-separated tabular data.
>
> 1. He try to format it, using expand -t 8
> 2. He see it's not good enough, he does it again with expand -t 10
> 3. He see it's okay for some columns, but is too wide for others. Then he uses column -t
It seems to me that the only thing this scenario proves is that
sometimes you need to use "expand", and sometimes you need to
use "column -t". They are different tools, with different purposes.
> I follow the idea that usage leads to tools, that "you have tools for a
> usage", while traditional column tool seems to design from tools to
> usage, that "you have tools which can used for usages". I guess this is
> more rational from learning prospective.
The column utility was written to satsify a need! For any long skinny
list of text, it will put that list into *columns* that fit on the
screen better, so you don't have to do as much scrolling.
"column -t" also satisfies a need! It takes ragged columns of output
and spreads them out so they are nicely aligned... and therefore
readable.
I hope I have understood your argument correctly,
Phil
Reply to: