Yes, the article says the input is awful, but this headline implies the code is awful.
+1
I was think something along the lines of, look at this stupid person who needs 64 lines of code to do a simple insert in a binary tree.
Can you give some brief examples of what you might do differently? Particularly, how would you solve the problem with fewer lines of code and/or complexity?
I'm suggesting the Python code is not bad at all, so this headline is just confusing. Personally I'd just use regex replace to convert the data rows to CSV directly, not as thorough as the Python code.