Query CSV files in SQL or alike

Jun 21, 2018 11:46

I need a small utility (suitable for embedded Linux) to make complex queries to CSV files, sql-style. Don't bash me, don't gawk on me, shell utilities I used just don't cut it.

Here's my notes - what I found.

* q (I' using it now) Works great, not suitable for embedded b/c Python+libsqlite.
* txt-sushi/tssql: in Haskell, must be pretty OK. Haskell doesn't have to be Go whose binaries are hardly smaller than 10M.
* mlr (Miller) "awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON". Quite good, though a binary is a bit big (~2M).

A bit different functions:
* asql only parses Apache logs, needs Perl.
* csvkit Only does a subset of relational algebra.
* comp: interesting tool, interesting language, not exactly clear what formats it parses (JSON only?). Written in Go, not for embedded, no documentation, not supported.
* jq - fantastic "sed for JSON". Written in C, great for embedded. A pity I don't need to parse JSON.
Previous post Next post
Up