ascii_table

Commands ››
Parent Previous Next

The ascii_table command is used to format CSV into "ascii art" tables. These are useful for presentation and documentation.

See also: to_xml

Flag

Req'd?

Description

-h header

No

A comma-separated list of strings which will form the headers of the table. If the special string "@" is used, the headers are taken from the first row of the CSV input. If no headers are specified, the table is produced without headers.

-ra fields

No

A list of fields which will be right-aligned rather than the default left alignment. This is useful for numeric fields.



The following example outputs the names.csv file, with suitable headers:

csvfix ascii_table -h "Forename,Surname,Sex" data/names.csv

which produces:

+----------+----------+-----+
| Forename | Surname  | Sex |
+----------+----------+-----+
| Charles  | Dickens  | M   |
| Jane     | Austen   | F   |
| Herman   | Melville | M   |
| Flann    | O'Brien  | M   |
| George   | Elliot   | F   |
| Virginia | Woolf    | F   |
| Oscar    | Wilde    | M   |
+----------+----------+-----+

Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator