Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda