Skip to content

Incorrect parsing of wrapped values #214

@pavelhoral

Description

@pavelhoral

Background Information

  • Module Version: master
  • Node/Browser Version: irrelevant

The issue I'm reporting is with:

  • json2csv
  • csv2json

I have...

  • searched to see if an issue has already been reported.
  • verified that my JSON/CSV data is valid (using something like http://jsonlint.com or https://csvlint.io/).
  • tried upgrading to the latest version of json-2-csv (since the issue may already be fixed).

Expected Behavior

Quoted values split across multiple lines should be correctly parsed.

Actual Behavior

The parser behaves incorrectly when the end quote is at the start of a new line.

Data Sample

CSV:

first,second
"hello
",world

This is being parsed as:

[
  {
    "first": "\",world\n"
  }
]

I did try to fix it but the parser makes almost no sense to me so I am creating this issue and going to find another library or write my own parser :). Good luck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions