Working With CSVTK
There’s a small tool called csvtk
which can be used to do various things with CSV files on the terminal. It’s… fine. If I had my own way, I would’ve made different decisions. But one thing going for it is that it exists, and my fantasy tool does not, so it’ll do for now.
Anyway, here’s a collection of common operations that this tool supports.
Grep
The grep subcommand requires both the field, using -f
, and the pattern, using -p
:
csvtk grep -f ok -p false file.csv
The -f
switch accepts a (glob?) pattern, so to grep over all fields, set -f
to "*"
csvtk grep -f "*" -p false file.csv