BrianHicks/elm-csv/2.0.1

NOTE: the latest version is 4.0.1

Csv.Parser

CSV (and TSV) parsing.

Parsing

{ fieldSeparator : Char }
-> String
-> Result Problem (List (List String))

Parse some data into a string-only list of lists. Prefer using Csv.Decode.decodeCsv or Csv.Decode.decodeCustom unless you need something unusally custom (and please open an issue if you do!)

type Problem
= SourceEndedWithoutClosingQuote Int
| AdditionalCharactersAfterClosingQuote Int

Something went wrong during parsing! What was it?

  • SourceEndedWithoutClosingQuote: we started parsing a quoted field, but the file ended before we saw a closing quote. If you meant to have a literal quote in your data, quote the whole field and then escape the literal quote by replacing it with "". For example, ": double prime would be escaped as "": double prime
  • AdditionalCharactersAfterClosingQuote: we found the closing pair of a quoted field, but there was data after it instead of the end of the file or a separator. Follow the quote-escaping advice above to get around this.