Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda