lovasoa/elm-csv/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Csv

A CSV parser.

Parser

type alias Csv =
{ headers : List String
, records : List (List String)
}

The Csv type structure.

parse : String -> Csv

Convert a string of comma-separated values into a Csv structure.

-- { headers = ["id", "value"], records = [["1", "one"], ["2", "two"]] }


Csv.parse "id,value\n1,one\n2,two\n"
split : String -> List (List String)

Convert a string of comma-separated values into a list of lists.

-- [["id", "value"], ["1", "one"], ["2", "two"]]


Csv.split "id,value\n1,one\n2,two\n"