fast-csv icon indicating copy to clipboard operation
fast-csv copied to clipboard

parse empty field value as null

Open geohuz opened this issue 4 years ago • 1 comments

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.

geohuz avatar Aug 10 '21 10:08 geohuz

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.

fubar avatar Jan 21 '22 04:01 fubar