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

CSV Parsing fail when extra cell with no column #406

Open
MatteoGauthier opened this issue Nov 20, 2023 · 1 comment
Open

CSV Parsing fail when extra cell with no column #406

MatteoGauthier opened this issue Nov 20, 2023 · 1 comment

Comments

@MatteoGauthier
Copy link

MatteoGauthier commented Nov 20, 2023

Describe the bug

I'm trying to parse an ugly csv file, I got extra values on some records, here is an example :

Line 2 is failing because there is an extra value in this record. Expected 2 got 3

"name","address"
"Bihl Christian","16","Rue De Kingersheim 68270 Wittenheim France"
"Levy Guilene","1 Rue D Ottmarsheim 68170 Rixheim France"
{
    "code": "CSV_RECORD_INCONSISTENT_COLUMNS",
    "message": "Invalid Record Length: columns length is 2, got 3 on line 200"
}

To Reproduce

parse(csv, {
      columns: true,
      delimiter: [","],
    })

How can I clean ugly CSV file and success to parse this CSV by removing ugly data.

@wdavidw
Copy link
Member

wdavidw commented Nov 20, 2023

Have you tried the relax_column_count option?

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

2 participants