Sujet : Re: [gawk] Handling variants of CSV input data formats
De : mcollado2011 (at) *nospam* gmail.com (Manuel Collado)
Groupes : comp.lang.awkDate : 26. Aug 2024, 18:01:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <ed42d44f-902e-40c1-956f-a3d5c215682c@gmail.com>
References : 1 2 3
User-Agent : Mozilla Thunderbird
El 26/8/24 a las 14:54, Janis Papanagnou escribió:
My opinion on this is that I wouldn't expect GNU Awk to become a (yet
another) CSV-processor. It's very convenient to have an easy input of
CSV data to be processed like other tabular data with Awk. So removal
of the (outer) quotes, transforming "inner" quotes of fields according
to the CSV-standard(s), and handling the escape symbol, would serve my
expectations. (I don't need CSV-output formatting, but I understand if
there is such a demand.)
Perhaps you could try my gawk-csvio pure gawk library. Just include a first unconditional rule calling csvimport(...) and the CSV input data will be automatically converted to a regular OFS-delimited record ready to be processed.
Please find the library at
http://mcollado.z15.es/gawk-extras/. The documentation is available also to be read before downloading.
HTH