Is there an easy way to split comma-delimited lines of text into columns with some of the columns right-justified?
As a bonus, it would be nice to format numbers, but this probably isn't too hard with sed.
|
Is there an easy way to split comma-delimited lines of text into columns with some of the columns right-justified? As a bonus, it would be nice to format numbers, but this probably isn't too hard with sed. |
||||
|
|
|
Awk and the
If you have numeric fields, you can use other printf formats. If you have the BSD utility You could do everything in Perl. Its format facility may help. A more powerful approach to table formatting with common unix tools is Yet another possible tool is the text mode browser w3m, which is good at table rendering. Here, you'd have to convert the input to HTML. |
|||
|
|
Ended up figuring this out myself. Instead of
to produce columns of width 20, with the first column left-justified, the other two columns right-justified, and the last column with two decimal places of precision. |
|||
|
|