BrianHicks / elm-csv

Decode CSV in the most boring way possible.

Home Page:https://package.elm-lang.org/packages/BrianHicks/elm-csv/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Incorrect handling of quoted fields

ad-si opened this issue · comments

> import Csv.Parser exposing (parse)

> parse { fieldSeparator = ',' } "Name,Species\nAtlas,cat\nAxel,dog\n"
Ok [["Name","Species"],["Atlas","cat"],["Axel","dog"]]
    : Result Csv.Parser.Problem (List (List String))

> parse { fieldSeparator = ',' } "\"Name\",\"Species\"\n\"Atlas\",\"cat\"\n\"Axel\",\"dog\"\n"
Ok [["Name","Species"],["Atlas","cat"],["Axel","dog",""]]
    : Result Csv.Parser.Problem (List (List String))

When the fields are quoted, it wrongly adds an additional empty field at the end.

how strange! Feel like making a PR? It's unlikely that I'll be able to get this fixed very quickly. :\

Fixed and released as 3.0.3. Hope you have a nice day!