0 purchases
csv ya
Yet another CSV parser that you may want.
Features #
Tolerant quate escaping.
Streaming conversion for very large files.
Motivation #
Have you ever seen a CSV like this:
x ,y
" an" "escaped"(string) ,ok
copied to clipboard
Be attention the white space trimming and continuations of quote escaping.
Most RFC4180 compliant CSV parsers fails to parse this.
But these data are so many in the wild where I live.
So I made this library.
We can parse this to:
[
{
"x": " an escaped(string)",
"y": "ok"
}
]
copied to clipboard
Usage #
const input = 'a,b,c\n1,2,3';
print(parseCsv(input));
>>> [['a', 'b', 'c'], ['1', '2', '3']]
print(parseCsvAsMap(input));
>>> [{'a': '1', 'b': '2', 'c': '3'}]
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.