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

129
Views
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
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!