csvjson icon indicating copy to clipboard operation
csvjson copied to clipboard

Double quotes in CSV cause error

Open pkhpkh opened this issue 5 years ago • 2 comments

This is a duplicate of unsolved #12.

When running this code:

const csvjson = require('csvjson');

const options = {
  delimiter: ',',
  quote: true
};

const data = `one,two
"some data", "some ""other"" data"`;

const obj = csvjson.toObject(data, options);

console.log(obj);

the output is:

[ { one: 'some data', two: 'data' } ]

and should be:

[ { one: 'some data', two: 'some "other" data' } ]

This also occurs with the quote option set to '"'.

pkhpkh avatar Mar 05 '19 19:03 pkhpkh

I am also facing the same issue. Is there any timeline for resolving this issue?

Naitik333 avatar Nov 06 '19 09:11 Naitik333

I am also experiencing this. Any solutions or alternative npm packages that might do better?

kenirwin avatar May 03 '23 20:05 kenirwin