create text tables from delimited files.

2013-07-12 166 words 1 min read

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 < <EOF >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

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it