I use column -t to format data for easy viewing in the shell, but there seems to be no option to specify column alignment (e.g. align to the right).
Any Bash one-liners to do it? I have arbitrary number of columns.
|
I use Any Bash one-liners to do it? I have arbitrary number of columns. |
||||
|
|
|
UPDATE: added a script (not a one liner, though) which allows you to choose which columns you want justified... It caters for Left (default) and Right (not Center).. As-is, it expects TAB delimited fields. You can change the column output seperator via $S.
Typical output:
Note:
From here on is the original answer which is related to but doesn't specifically address tne main issue of th question.. Here is the "one-liner" which suits integers (and allows +/- signs) .. The "X" place-holder forces
Typical output
If you have float values, or floats mixed with integers, or just integers, (optional leading +/- signs), a bit more shuffling works.
Typical output
|
||||
|
|
|
From a simple point, I'd use
This makes for slightly wider |
|||
|
|