coreutils
[Top][All Lists]
Advanced

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

Re: New coreutil suggestion - tableize


From: Guillaume Kielwasser
Subject: Re: New coreutil suggestion - tableize
Date: Sun, 27 Nov 2011 18:30:48 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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.


Regards,
Guillaume





reply via email to

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