lmemsm ([personal profile] lmemsm) wrote2023-10-03 08:35 am

CSV Utilities

This list is to consolidate information on basic CSV related utilities and libraries. If you know of other interesting CSV resources, code or have some tips and tricks for making the most of the CSV format, please share them.

Some useful CSV libraries:

https://github.com/rgamble/csvutils
https://github.com/rgamble/libcsv

https://github.com/wlbr/csvfix
https://github.com/dbro/csvquote

Pager with CSV support:
https://github.com/okbob/pspg

SQLLite can work with CSV.
https://www.sqlite.org/csv.html

I've accessed CSV using PERL and DBI.
https://github.com/perl5-dbi/DBD-CSV

ODBC:
The Microsoft Text ODBC Driver is standard on Windows. So it's free even if it's not Free.
https://support.microsoft.com/en-us/topic/creating-an-odbc-data-source-with-the-microsoft-text-driver-74367d5b-8a17-6310-ce15-a1c47858964a
Hopefully there are drivers for UnixODBC or iODBC. However, I couldn't find any links with a quick search.

I used a wonderful jquery plugin in one of the sites I created. It took a CSV file as input and created a HTML table that could be viewed and sorted. I was also able to add stripes (different colors to alternate rows) using CSS. For accessibility, I gave the direct link to the CSV file in the noscript tag. So, if someone did not want to run JavaScript, they could see the contents in the file rather than on screen in a web browser. Here's the jquery plugin I used:
https://web.archive.org/web/20090227064509/http://plugins.jquery.com/project/csv2table
Code for the project is available here as well:
https://github.com/toshirot/csv2table