Even shorter with r and probably a good deal quicker
r -e "data.table::fread(data.csv)[col1 != "foo", .(1,3)]"
r -e "data.table::fread(data.csv)[col1 != "foo", .(1,3)]"
> data.table::fread("version_downloads.csv")[date == "foo", .(1,3)]
Error: character string is not in a standard unambiguous format
Execution halted
Dunno how to fix this now.And I have no idea which string to fix or how to even fix it. The failure mode here is not great.
https://www.rdocumentation.org/packages/data.table/versions/...
Or you can pass colClasses = 'character' as an argument to read everything as a string, but that will be much much slower.
fread also reads from stdin so you can pass bash commands into the first parameter instead of using bash to run r via R -e.
Full disclosure, I'm the author of 'xsv' and the thing I was most interested in here was performance.