Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Split a Javascript string by comma, but ignore commas that would be inside a string

So I'm working with uploading CSV files, and I'm trying to find a way to split a string by commas. The problem is, when my CSV comes back, each item is just one long string, with each data variable being separated by a string. Inside each variable, a string could contain a comma. So how do I delineate which comma I would need to separate by? For example, when console logging a file, I'll get a response like this: enter image description here

So as you can see, each item comes back as one long string. When I break it down by each item in the array it looks like this:

enter image description here

(when there are multiple commas in a row, it just means that the field is empty)

Is there a way to maybe change the separator that is being used when the csv file is being read? Or how do I go about dictating the correct comma to separate by?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!