News for hackers. Stuff that matters.
Re:Awk: `Begin { ` Part 1 by forinti on Friday October 30, 2020 @10:04AM (#24942283)
I parse a lot of CSV files and few are well-formed.

People are careless when writing CSV files because they think it is simple: just put a comma between columns, right?

Re:Awk: `Begin { ` Part 1 by e12e on Friday October 30, 2020 @05:30PM (#24947079)
I just fixed a bug at work, parsing a rather opinionated csv file of products for a web shop. It had mostly good quoting, headers for columns - and uses semicolon for field separation (so, not technically csv, but..).

Funny thing was, a lot of the product names contained an ampersand (no problem there). But one product had an html entity encoded ampersand (&). I have no idea how that semicolon escaped, eh, escaping - but that one line suddenly had most of the columns off by one...

I can see how the entity got into the db (probably errant cutnpaste) - but I wonder at the csv writer that gleefully copied the extra separator to the csv export...