mholt/PapaParse

Quote only strings and not numbers

开放

#532 创建于 2018年7月5日

 (3 条评论) (0 个反应) (0 位负责人)JavaScript (1,186 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (13,552 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

I'm parsing the following file (quoted strings, non-quotes numbers):

name,age,city
"Chirstian",30,"Hamburg"

The option dynamicTyping detects name and city as strings and the age as number. If I unparse, I have two options.

Option 1) set quoteChar: '"', which results in:
name,age,city
"Chirstian","30","Hamburg"
Option 1) Skip the option `quoteChar, which results in:
name,age,city
Chirstian,30,Hamburg

I recommend an option onlyQuoteStrings, which applies the quoteChar: '"' only to strings, but not to numbers, similar to libre office save as CSV dialogue (option quote all text cells):

bildschirmfoto vom 2018-07-05 23 59 54

贡献者指南