[Haskell-cafe] empty fields are dropped in bytestring csv

Tom Doris tomdoris at gmail.com
Sat Feb 18 00:16:12 CET 2012

the bytestring-csv package appears to have a bug whereby empty fields are
dropped completely from the row, which is different to Text.CSV , which
will return an empty field in the parse result. I'd argue this is a bug in
bytestring-csv, anyone know whether this has been raised before, or know of
a workaround?

Prelude Data.Maybe Data.List Text.CSV.ByteString Data.ByteString.Char8>
parseCSV $ pack "a,b,c\n1,2,3\n1,,9\n"
Just [["a","b","c"],["1","2","3"],["1","9"]]

-- the last row has two fields ^

Prelude Text.CSV> parseCSV "/tmp/err" "a,b,c\n1,2,3\n1,,9\n"
Right [["a","b","c"],["1","2","3"],["1","","9"],[""]]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120217/4bcb0c60/attachment.htm>

More information about the Haskell-Cafe mailing list