Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Fantastic article!

It's missing: - "what if the quotes are smart quotes?" - This applies to both quotes inside a field and quotes wrapping a field - "what if the file doesn't have a header?" - "what if a logical record is spread over multiple lines?" - Yeah... so, you have line 23 that has the majority of the data in the expected columns, line 24 has additional data in columns 23, 25, and 28 that's supposed to be appended onto the previous line's data that also appears in columns 23, 25, and 28. Line 25, same thing, but line 26 starts a new logical record.

Seen all three above in the wild and Python's (pretty awesome) CSV code didn't handle them. Queue the custom code that wraps Python's core CSV parsing.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: