4 ms·
Could one get away with regular AWK using these combined with a streaming to/from CSV converter?
by RhysU 4y ago
Could one get away with regular AWK using these combined with a streaming to/from CSV converter?
- cb321 4y agoNot just "regular awk", but "regular most things", like head, tail, grep, etc. The "things" just need to be 8-bit/NUL handling clean and the data could even have binary fields. I mean, if there is a library like Python/Go/etc. that you especially trust to write a streaming converter then that is a fine approach, but otherwise see both https://news.ycombinator.com/item?id=31352517 https://news.ycombinator.com/item?id=31352517 and https://news.ycombinator.com/item?id=31352704 https://news.ycombinator.com/item?id=31352704 (at least!)
- mmcgaha 4y agoYes and I suspect that this is why it was never added to AWK. I,and I am sure most people, have an AWK filter to transform their csv or whatever format to a format that AWK can use with an appropriate FS and RS. Their "but why" section should really go into more detail about why filters are not 100% if your data has the possibility of containing your preferred line/record separator. But real world, I have never had a situation where a csv-to-awk filter (written in awk of course) did not work.