Skip to content

Breaks when delimiter showing up inside row values #2

@thunderchao

Description

@thunderchao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions