3 ms·
> For CSV? DuckDB, Datasette, awk, pawk, and tons of others. Those tools are either line- or table-oriented, and thus don't handle CSVs as a structured format.
by rewmie 3y ago
> For CSV? DuckDB, Datasette, awk, pawk, and tons of others.
Those tools are either line- or table-oriented, and thus don't handle CSVs as a structured format. For instance, is there any easy way to use AWK to handle a doc where one line has N columns but some lines have N+1, with a random column entered in an undetermined point?
- two_handfuls 3y agoThe CSV Spec (1) specifies that “Each line should contain the same number of fields throughout the file”, so what you describe would be a noncompliant file. Nevertheless, I would expect both awk and pawk to be able to work with it just fine. Both pawk and the recent version of awk can parse the CSV format correctly (not just splitting on commas, but also handling the quoting rules for example). 1: https://www.rfc-editor.org/rfc/rfc4180 https://www.rfc-editor.org/rfc/rfc4180