Skip to content

Double quotes in CSV cause error #28

@pkhpkh

Description

@pkhpkh

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 '"'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions