Live data from Hacker News

So You Want to Write Your Own CSV code

tburette.github.io

1–10 of 127 posts

Re: So You Want to Write Your Own CSV code

#4
post #2

So, which library? CSV is a mess.

No idea. I've been bitten by a library that turned out well into a project to have pernicious flaws.

It would be awesome if someone made a table with CSV features in one dimension and application/library behaviour in the other.

Re: So You Want to Write Your Own CSV code

#5
post #2

So, which library? CSV is a mess.

No idea. I've been bitten by a library that turned out well into a project to have pernicious flaws. It would be awesome if someone made a table with CSV features in one dimension and application/library behaviour in the other.

The problem is that CSV is basically non discoverable, as it has no metadata eg about encoding or delimiters or locale... Thats why Excel gives you a sample and lets you change delimiters etc. You can guess, or you can write something that seems to work for a particular input source. But it is best avoided.

Re: So You Want to Write Your Own CSV code

#10
post #6

Why are people using CSV when better (and less fuzzily defined) solutions exist, such as JSON?

Importing into excel is probably a big reason.

If Excel compatibility is the goal, one should use libraries that read and produce Excel files.

CSV is bullshit, it's not good for anything except scenarios where you control both the export process, and the parser (so you know what delimiter is used and so on).

Post reply on HN