pkoppstein
pkoppstein
> Does it mean the feature won't be implemented? I'm not sure what "feature" you mean, but as illustrated, it's trivially easy to convert a JSON string with embedded commas...
1. Currently, the best way to get jq to read a CSV file is to use EITHER a CSV-to-TSV or CSV-to-json program that can pipe into jq, or perhaps to...
> That needs a bit more work, but it does work Yes, it works well, except perhaps for the handling of embedded carriage-returns. It would at least be desirable for...
@nicowilliams - Yes, I guessed as much, but there is so much confusion/disagreement/inconsistency about this particular point, I thought it would be worthwhile illustrating how well-behaved `@csv` actually is.
Here's `troublesome.csv`, for which the invocation: jq -rR 'include fromcsv; fromcsv|@csv' should (I think we're agreed) be idempotent: ``` "C1","C2","C3","C4","C5" "1"," ","5,9,13,17" "esctab","\t","10","14","18" "tab"," ","11","15","19" "4","8","12","16","20" "split line" "foo\\nbar" ```...
@nicowilliams wrote: > It works fine if you add -s to the jq command-line! Can you figure out why? :) Yes, but if one uses -s in conjunction with this...
@fadado wrote: > I prefer (./"")[] to explode[]|[.]|implode but I've not profiled the code. Alas, using / is a little faster but requires way more memory: ``` $ /usr/bin/time -lp...
@nicowilliams - Yes, I also thought of the name `explodes` :-) By "ordinary CSV" I mainly meant: (a) there are no embedded raw newlines; (b) fields need not always be...
@nicowilliams - I was careful to put "standard" in quotation marks. (Maybe I should have written `"""standard"""` :-) FWIW, it's been my view that CSV is such a mess, and...
[@nicowilliams - This is not a request or suggestion that you spend more time on this!] The latest version works splendidly except when non-quoted fields are encountered. E.g. for the...