mholt/PapaParse

encode null/missing values in unparse

Open

#350 创建于 2016年10月17日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (11,877 star) (1,157 fork)batch import
good first issuehelp wantedsuggestion

描述

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?

贡献者指南