Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Papa.parse(): comments donot support newline #1072

Open
Joelei opened this issue Oct 31, 2024 · 1 comment
Open

Papa.parse(): comments donot support newline #1072

Joelei opened this issue Oct 31, 2024 · 1 comment

Comments

@Joelei
Copy link

Joelei commented Oct 31, 2024

Here is the input sample:

,A,B
#,"Comment of A have
multi lines",Comment of B
,"Data of A have
multi lines",Data of B

config is:

{
  quoteChar: '"',
  escapeChar: '"',
  header: true,
  comments: '#',
  skipEmptyLines: true,
}

I expect to read correctly a line of data:

[
  {"": '', A: 'Data of A have\nmulti lines', B: 'Data of B'}
]

But it throw "FieldMismatch" error, and the parsed data is:

[
  {"": 'multi lines"', A: 'Comment of B'},
  {"": '', A: 'Data of A have\nmulti lines', B: ' Data of B'}
]

If change the sample to this:

,A,B
#,Comment of A,Comment of B
,"Data of A have
multi lines",Data of B

This sample can be parsed correctly.

Does that mean parser doesn't support newline in comment lines?

If not, how can I get the result I want?

@Joelei Joelei changed the title *Papa.parse()*: comments donot support newline Papa.parse(): comments donot support newline Oct 31, 2024
@Joelei
Copy link
Author

Joelei commented Nov 4, 2024

Relative disscussion:
#1031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant