Hacker News new | ask | show | jobs
by johnnyo 848 days ago
I don’t think so, because their are always ambiguities with CSVs

Do they have a header? Is the data properly escaped? How are blank values at the end of the row handled? Etc, etc

1 comments

> their are always ambiguities with CSVs

Right, that's the point of a good library, to handle the ambiguities via insightful coding solutions, accumulated over decades - enough solutions to make it worth using the library. Other ambiguities can be handled with Q&A which result in automated solutions: 'the text looks like either X or Y, which is it?', and then disambiguating the text based on the answer.

Another benefit would be that, if the library became useful and widely used enough, it would become an unofficial standard: people would make CSV's compatible with the library and its output would become a norm.

All a happy fantasy! :)

Insightful solutions aren’t always correct solutions.

Take a look at how Excel helpfully makes things dates or numbers, even when you don’t want them to be treated as such.

There’s no “insightful” way to understand that a column of numbers really wants to be treated like text or that 20-DEC-82 is a product code vs a date.