Can anybody recommend a way to parse CSV files with options to:
I did try Text.CSV but it's very simple and lacks most of the above features. Is there some more advanced CSV parsing module or do I have to write it "from scratch" i.e. using Text.ParserCombinators? I do not intend to reinvent a wheel.
Take care.
I can't recommend a ready-to-go, packaged-up CSV parser for Haskell, but I remember that the book Real-World Haskell by Bryan O'Sullivan et al. contains a chapter on Parsec, which the authors demonstrate by creating a CSV parser.
The relevant chapter 16: Using Parsec is available online; check the section titled Extended Example: Full CSV Parser.
This is an old thread, but both csv-conduit and cassava have most, if not all -- not sure about re-writing to the file -- of the features you're looking for.
A quick search on Hackage finds Data.Spreadsheet, which does have customizable quote and separator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With