json2csv icon indicating copy to clipboard operation
json2csv copied to clipboard

excelStrings option works incorrectly with quoted values

Open mikhalev-im opened this issue 5 years ago • 2 comments

Version of json2csv: 5.0.5 Node version: 12.19.1

Code:

const { Parser } = require('json2csv');

const parser = new Parser({
  header: false,
  delimiter: ';',
  excelStrings: true,
});

const data = {
  field1: 'string',
  field2: '"quoted"'
};

parser.parse(data);  // result: "=""string""";"=""""quote"""""

If you write the result to a file and open it in excel, there would be an error in a quoted value:

Снимок экрана от 2021-01-27 10-33-07

The tooltip is saying that the formula has an error.

mikhalev-im avatar Jan 27 '21 07:01 mikhalev-im

Guys, thank you for your work! Do you know when this fix will be released on npm?

mikhalev-im avatar Feb 03 '21 13:02 mikhalev-im

Should be released as [email protected]

knownasilya avatar Feb 03 '21 15:02 knownasilya