3 ms·
For working with complex CSV files, I highly recommend checking out CSVKit https://csvkit.readthedocs.org/en/0.8.0/ https://csvkit.readthedocs.org/en/0.8.0/ I'
by CGamesPlay 12y ago
For working with complex CSV files, I highly recommend checking out CSVKit https://csvkit.readthedocs.org/en/0.8.0/ https://csvkit.readthedocs.org/en/0.8.0/
I've just started using it, and the only limitation I've so far encountered has been that there's no equivalent to awk (i.e. I want a way to evaluate a python expression on every line as part of a pipeline).
- vdm 12y agoGet words starting with "and" $ cat /usr/share/dict/words | py -fx 're.match(r"and", x)' | head -5 and andante andante's andantes andiron https://github.com/Russell91/pythonpy https://github.com/Russell91/pythonpy
- CGamesPlay 12y agoSorry, I meant: remove the characters "$" and "," from the 3rd column of a CSV file. Obviously the CSV file is quoted, since it has commas in the 3rd column, and so awk is no longer an acceptable solution.