mholt/PapaParse

encode null/missing values in unparse

オープン

#350 opened on 2016/10/17

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (1,186 件のフォーク)batch import
good first issuehelp wantedsuggestion

Repository metrics

Stars
 (13,552 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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?

コントリビューターガイド