mholt/PapaParse

encode null/missing values in unparse

Offen

#350 geöffnet am 17.10.2016

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.186 Forks)batch import
good first issuehelp wantedsuggestion

Repository-Metriken

Stars
 (13.552 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Hi papas,

CSV has no concept of null. You can't distinguish between empty strings and null. (good read: http://www.garretwilson.com/blog/2009/04/23/csvnull.xhtml)

Nevertheless, there are cases where you need to support both cases, so a solution might be to encode it as a special String like "NULL" or so (if its unlikely that this string will ever occure as a string in your app).

If you feed data where some fields are missing to papa.unparse, these fields will be empty in the resulting csv. is it possible to define another value for missing data, so that you could define "NULL" or similar for theses cases?

Contributor Guide