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

So, which library? CSV is a mess.



Here's some links which (will always) point to latest versions on MetaCPAN:

http://p3rl.org/Text::CSV | http://p3rl.org/Text::CSV_XS


I really have to second this. It's fast, it's smart, it handles almost anything, and it reliably gives good error messages. It's an important part of my data science toolbelt.


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.


I would say use the parser included in your programming environment, but I spend way to long looking of the non existing CSV parser in .Net.


Not a single language I use on a routine basis includes a CSV parser in its standard library.


I'm mostly using Python and trying to learn Go, both have great csv parsers and I used the one in PHP. Given the size and features present in .Net I was really suprised to not find a csv parser.


ocaml-csv can handle anything Excel can throw at it (and throw it back). Worked out well in the real world.

https://forge.ocamlcore.org/projects/csv/


Have you tried Papa Parse?




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

Search: