Home » bash » Fedora » create text tables from delimited files.

create text tables from delimited files.

To create simple text tables to paste in emails or to use in any other document where you want to show a table, here is something that you can use. There is a perl module which provides “tablify“. And here is how to use it:

sudo yum install perl-Text-RecordParser

This will install a command “tablify” that you can use in number of ways. Here is a simple example to use it. You can read the man pages to see how you can use it.

: tmp ; cat < b.tab 
1	2001
2	3001
3	5001
4	1001
EOF

: tmp ; tablify --no-headers b.tab 
+--------+--------+
| Field1 | Field2 |
+--------+--------+
| 1      | 2001   |
| 2      | 3001   |
| 3      | 5001   |
| 4      | 1001   |
+--------+--------+
4 records returned

Enhanced by Zemanta

Leave a Reply