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

138
Vistas
How to parse CSV file with string objectkeys instead of "raw" strings?

I tried parsing a CSV file in Javascript and I got the following results:

[ 
  {
    'Title': 'Random Brand 1',
    'Brand Code': '5205',
    Display: 'Brand'
  },
  {
    'Title': 'Random Brand 2',
    'Brand Code': '5201',
    Display: 'Sponsorship'
  },
  {
    'Title': 'Random Brand 3',
    'Brand Code': '5203',
    Display: 'Both'
  }
]

The "Title" keys are wrapped in quotes, but Display does not. "Brand Code" is in quotes which is fine because it's two words. How do I parse it so that Title will be like Display and has not quotes? Something like this:

  {
    Title: 'Random Brand 3',
    'Brand Code': '5203',
    Display: 'Both'
  }

I am parsing the file like this:

import csvParse from 'csv-parse/lib/sync'
const brands = csvParse(fs.readFileSync(csv), { columns: true })

Do I have to change something on Excel?

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