fast-csv
fast-csv copied to clipboard
parse empty field value as null
Parsing or Formatting?
- [ ] Formatting
- [x ] Parsing
something like:
a b c
,,,
should be parsed as :
[{
a: null,
b: null,
c: null
}]
I could not find a option to make the parsing output the above json, the parsed output is always like {a: ""} But it is critical for validation.
I came here to post this exact issue. A CSV row like "foo","" is semantically different from "foo",: The second value should be returned as an empty string in the first example, and as null in the second one. Both examples currently result in an empty string.