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

194
Views
Best way to parse a CSV into a JS app, create, and let the user populate a new column?

I need to parse a CSV file to json (or array, still trying to search for the best method!),

  • show the data to the user in a container,
  • create a new column on that same csv for LABELLING, and letting the user populate it according to clicking some buttons on the app,
  • and save the new schema to local computer.

How should I approach this problem?

I've been reading into data-grid, handsontable and papaParser, but I'm still very confused. I'm still kind of a beginner at javascript. It would be a big help if you could give me the big picture on the best way in how proceed with this, I'm sure I could troubleshoot the technical details on my own. Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Handsontable does not allow you to use CSV as the datasource so you would need to parse it to JSON first using another library. Using JSON itself requires some additional setup - especially when you have a nested structure of data. Then you might need to use the columns option the specify objects for a given column.

Within the abilities of that grid, you can alter columns and those would be reflected in a new CSV file generated by the exportToFile plugin.

The exportToFile plugin allows you to set some values as the delimiter or ability to show/hide headers to keep the consistency with your input CSV structure.

Example

const exportPlugin = hot.getPlugin('exportFile');

button.addEventListener('click', () => {
  exportPlugin.downloadFile('csv', {
    bom: false,
    columnDelimiter: ',',
    columnHeaders: false,
    exportHiddenColumns: true,
    exportHiddenRows: true,
    fileExtension: 'csv',
    filename: 'Handsontable-CSV-file_[YYYY]-[MM]-[DD]',
    mimeType: 'text/csv',
    rowDelimiter: '\r\n',
    rowHeaders: true
  });
});
about 4 years ago · Juan Pablo Isaza Report
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!