tablign
tablign copied to clipboard
Aligns columns in your ASCII tables on the command line or in vim.
Aligns columns in your ASCII tables.
Install with
pip install tablign
tablign in.txt out.txt
you can convert your input file
| A | 1.34|-214.1|
|CCCC | 55.534| 1131.1|
into
| A | 1.34 | -214.1 |
| CCCC | 55.534 | 1131.1 |
Column widths are unified across the table, decimal dots are aligned, and tablign tries
to be smart about column separators. Works for CSV, LaTeX, Markdown etc. By default,
tablign
reads from stdin and writes to stdout, so you can use pipes with tablign, too:
head -n in.txt | tablign
Usage from vim
Simply mark the table (shift-V), and type
:'<,'>:!tablign
Alternatives
GNU's column
command is a mighty alternative:
column -t
See here for more alternatives.