javascript-csv-array-example icon indicating copy to clipboard operation
javascript-csv-array-example copied to clipboard

Breaks when delimiter showing up inside row values

Open thunderchao opened this issue 4 years ago • 0 comments

My source CSV has values that contain commas. Every value has double quotes around it. How would I change this code to skip the commas that are inside of double quotes?

Code example: ID,Full Name,Address "85DD-019F","Alice","123 Park Ave, Topeka, KS, 66618"

I've tried setting the delimiter to '/,(?=(?:(?:[^"]*"){2})*[^"]*$)/' (from this link) but then the array is the entirety of the row, then a bunch of undefined to fill out the rest of the values.

thunderchao avatar Feb 08 '22 22:02 thunderchao