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

Parsing issue in latest versions: unrecognized tabs #699

Closed
gltjk opened this issue Aug 14, 2019 · 1 comment
Closed

Parsing issue in latest versions: unrecognized tabs #699

gltjk opened this issue Aug 14, 2019 · 1 comment

Comments

@gltjk
Copy link

gltjk commented Aug 14, 2019

Greetings. I was parsing a csv file with PapaParse and encountered some problems. After some digging, I managed to locate the lines causing such problems, and hence recreated them with the following sample code.

I tested the code in the latest versions of Chrome, Firefox, and Node.js, together with the latest versions of PapaParse (v5.0.0 ~ v5.0.2), and the problem arose. However, when I turned to PapaParse v5.0.0-beta.0 or v4.x, everything worked just well.

The sample code is:

const text = 'h1\th2\th3\na1\ta2"\ta3\nb1\tb2"\tb3'
const result = Papa.parse(text, { header: true }).data
console.log(result)

Here's what I expected:

[
  { h1: 'a1', h2: 'a2"', h3: 'a3' },
  { h1: 'b1', h2: 'b2"', h3: 'b3' }
]

and this is the actual result I got:

[
  { h1: 'a1', h2: 'a2"', h3: 'a3' },
  { h1: 'b1\tb2"', h2: 'b3' }
]

Looking forward to a fix for this bug 😃

@dboskovic
Copy link
Collaborator

Thanks for the detailed example. Linking to a CodeSandbox here that replicates: https://codesandbox.io/s/crazy-thunder-2vjl7

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

No branches or pull requests

2 participants