node-csv
node-csv copied to clipboard
CSV Parsing fail when extra cell with no column
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.
Have you tried the relax_column_count option?