Re:Modernizing AWK, a 45-year old language, by adding CSV su...
by RhysU on Thursday May 12, 2022 @07:52AM
(#31352616)
Could one get away with regular AWK using these combined with a streaming to/from CSV converter?
[ Parent
| on HN ]
Re:Modernizing AWK, a 45-year old language, by adding CSV su...
by mmcgaha on Thursday May 12, 2022 @10:57AM
(#31355171)
Yes 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.
Re:Modernizing AWK, a 45-year old language, by adding CSV su...
by cb321 on Thursday May 12, 2022 @08:15AM
(#31352858)
Not 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 and https://news.ycombinator.com/item?id=31352704 (at least!)