Tablify

Tablify is a simple program I wrote to convert CSV files into various displayable formats. At the moment it supports four different output formats: HTML, tbl(1), as well as text art for ASCII and Unicode encodings.

Yes, I actually do enough with CSV files this is handy.

Usage

An example of each output method, given the following CSV file:


        Name,Age,Favorite Language,Quote
        Daniel Lyons,28,Haskell,"Try, try again"
        Reid "The Man" Givens,29,CSS,"I am not a programmer"
        
        $ tablify -H testdata.csv
        
Name Age Favorite Language Quote
Daniel Lyons 28 Haskell Try, try again
Reid "The Man" Givens 29 CSS I am not a programmer

screenshot of text art modes


        $ tablify -T testdata.csv
        
        .TS
        c c c c c
        l l l l l.
        Name    Age Favorite Language   Quote
        Daniel Lyons    28  Haskell Try, try again
        Reid "The Man" Givens   29  CSS I am not a programmer
        .TE
        

Take a look at an already formatted TBL output rendered to PDF, which I rendered using this command:

tablify -T testdata.csv | tbl | groff -Tps | ps2pdf - > testdata.pdf
        

Keep in mind this is just a fragment like the HTML output mode, in this case intended to be spliced into a larger roff document.

Dependencies

Download

You can download a package here: Tablify-0.7.tar.gz

Alternatively, if you are on a Mac and don’t want to install the ~111MB of dependencies and trust a stranger to hand you an executable you can run, you can download just the binary: tablify.bz2. I recommend looking at these checksums of the compressed file:

ProgramChecksum
md5sum76cb2269feb3bf8c6c123a721d7af7c7
sha1sumc14a0bd3b797f3bd2a94254f0e7515708c888ed3

Hopefully soon I’ll work up the nerve to submit this to Hackage.

License

This software is covered by the BSD license, which means you can basically do whatever you want with it.

Known Issues

Make sure your CSV file ends with a blank line or it will fail to parse.

Suggestions, Bug Fixes, Gripes

Please email me. You can find my email address in the package’s README.txt file or somewhere on this site.

I have taken some time and played around with ~5 MB CSV files and it hasn’t choked on them, but I haven’t bothered to try running it with anything larger than that.