A CSV parser that supports different separators, quoted fields, and multiline values. The results are provided as lists.
Parse the input string into a CSV Structure using a custom delimiter
parseWith '☃' "id☃value\n1☃one\n2☃two" =
{ headers = [ "id", "value" ]
, records =
[ [ "1", "one" ]
, [ "2", "two" ]
]
}Parse the input string into a CSV Structure
parse "value\n\"Here is a multiline \nvalue - 1,2,3\"\nsingle line value" =
{ headers = [ "value" ]
, records =
[ [ "Here is a multiline \nvalue - 1,2,3" ]
, [ "single line value" ]
]
}
The
Csvtype structure.