Lots of features, but slow because written in Python. A faster version may be csvtools. Also some annoyances like obtuse header handing and missing features like grep + cut in one go: csvgrep and select column in csvkit.
Simple example:
printf '00,11,22\n33,44,55\n' | csvgrep -H -c2 -r '^11$' | tail -n+2
output:
00,11,22
There seems to be no way without a pipe, you seem to need to reparse the columns, e.g. the tutorial at: csvkit.readthedocs.io/en/latest/tutorial/2_examining_the_data.html#csvgrep-find-the-data-you-need does:
csvcut -c county,item_name,total_cost data.csv | csvgrep -c county -m LANCASTER
A compiled executable under /usr/bin/csvtool, has an Ubuntu 23.04 package: manpages.ubuntu.com/manpages/lunar/en/man1/csvtool.1.html
There seems to be no sane filtering mechanism however: stackoverflow.com/questions/46540752/using-csvtool-call-to-filter-csv-in-bash
A fast version of a somewhat subset of csvkit, written in C.
Build failed with undefined reference to pcre_config on Ubuntu 23.04: github.com/DavyLandman/csvtools/issues/18
Unfortunately it is lacking some basic options, like optional header + selecting column by index on csvgrep (though csvcut has it). The project seems kind of dead.
Also unclear if it allows to filter + print only selected columns.
Is this the one?

Articles by others on the same topic (0)

There are currently no matching articles.