coreutils
[Top][All Lists]
Advanced

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

Re: New coreutil suggestion - tableize


From: Pádraig Brady
Subject: Re: New coreutil suggestion - tableize
Date: Sat, 07 Jan 2012 16:04:14 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 11/27/2011 05:30 PM, Guillaume Kielwasser wrote:
> Thanks Pádraig for your instructive input!
> 
>> Hmm, I wonder would it be worth augmenting `column -t` from util-linux
>> to add a --border option and also detect number cols and auto right align?
>> I guess a --header option would be useful too.
> 
> I have to admit I missed the '-t' option of column over the years!
> But for me printing tables is a bit distant from column's primary
> function, ie formating its input into multiple columns.
> 
> Refering to the adage "Each program should do one thing well. No more, no 
> less." [0],
> I would dedicate a program to print tables.
> 
> [0] http://www.gnu.org/s/coreutils/manual/coreutils.html
> 
> 
>> $ python -m prettytable
>> +-----------+------+------------+-----------------+
>> | City name | Area | Population | Annual Rainfall |
>> +-----------+------+------------+-----------------+
>> | Adelaide  | 1295 |  1158259   |      600.5      |
>> | Brisbane  | 5905 |  1857594   |      1146.4     |
>> | Darwin    | 112  |   120900   |      1714.7     |
>> | Hobart    | 1357 |   205556   |      619.5      |
>> | Sydney    | 2058 |  4336374   |      1214.8     |
>> | Melbourne | 1566 |  3806092   |      646.9      |
>> | Perth     | 5386 |  1554769   |      869.4      |
>> +-----------+------+------------+-----------------+
> 
> This is really nice :) However relying on such module could be hazardous, 
> as it could not be part of your system.
> 
> 
>> Note both util-linux and coreutils use a multi-byte aware alignment module¹,
> 
> Thanks, indeed will be useful!
> 
> 
>> This also notes other possible formatting options.
>> http://cxc.harvard.edu/contrib/asciitable/
> 
> yeah, a little bit far from the tableize perspective, but could be an 
> evolution.

I also notice the FreeBSD `rs` command which overlaps quite a bit:
http://www.freebsd.org/cgi/man.cgi?query=rs&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&arch=default&format=html

cheers,
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]