mholt/PapaParse

encode null/missing values in unparse

Open

#350 aberto em 17 de out. de 2016

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (1.157 forks)batch import
good first issuehelp wantedsuggestion

Métricas do repositório

Stars
 (11.877 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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?

Guia do colaborador