Questions tagged [papaparse]

Papa Parse is a fast and powerful CSV parser for JavaScript.

Papa Parse (formerly the jQuery Parse Plugin) is a robust and powerful CSV (character-separated values) parser with these features:

  • Easy to use
  • Parse CSV files directly (local or over the network)
  • Stream large files (even via HTTP)
  • Reverse parsing (converts JSON to CSV)
  • Auto-detect the delimiter
  • Worker threads to keep your web page reactive
  • Header row support
  • Pause, resume, abort
  • Can convert numbers and booleans to their types
  • Graceful and robust error handling
  • Minor jQuery integration to get files from <input type="file"> elements
  • Papa Parse has no dependencies - not even jQuery.

Visit the Papa Parse project page on GitHub.

Homepage & Demo

To learn how to use Papa Parse: see Documentation.

papaparse.min.js can be linked or downloaded to your project source.

418 questions
1
vote
0 answers

How to find the input type file in react papaparser and mock it to jest test case?

I am stuck at writing mock test case for react papaparser for csv file upload. It has a button and a div with x mark for clearing out input items from div. I am able to mock button and div but not able to mock the input type = "file" element in…
Chandan
  • 217
  • 1
  • 3
  • 17
1
vote
1 answer

Displaying local CSV data in a table in React

I'm new to react and only have an entry level understanding of coding but need to use it for a project. I'm trying to display data from a local csv file in a simple HTML table that can then be searched by a user on the page. So far I've only been…
1
vote
1 answer

Memory leak when using chunk/complete callbacks and worker

I pass the options as { ... chunk: () => this.chunk(results,parser), complete: () => this.complete(results,parser) } And this doesn't leak memory when worker is false but leaks memory when worker is true. The leak is because the closures are…
Siva
  • 1,096
  • 7
  • 20
1
vote
1 answer

How to create a counter using recursion to get the total employees(direct or indirect) under a manager_id in javascript?

I have an excel file with data like this Name WorkerId ManagerId Tom 179 180 Liz 150 179 Ricki 120 179 sona 113 150 Preet 558 150 mina 89 558 Yukti 45 120 And I want a function CountEmployee(manager_id) that will return all…
1
vote
0 answers

how to avoid double quotes for numbers in CSV papaparse

My below configuration will add double quotes for all the data, but I want to avoid double quotes for "Numbers" and "Date" type data, how can I do that. const universalBOM = "\uFEFF"; const link = document.createElement("a"); …
jake clark
  • 71
  • 6
1
vote
1 answer

Uncaught TypeError: root is undefined papaparse

I have a problem with papaparse in my code, I try to parse a string but is giving me this error: Uncaught TypeError: root is undefined" the code is like: import * as Papa from "../file/papaparse/papaparse.js"; input.onchange = e => { var file…
Ronco95
  • 31
  • 6
1
vote
2 answers

Export JSON as CSV with Papa Parse

I have an Ionic React app and want to download data as CSV. Therefore I added react-papaparse, but I am unable to download the data with the app. As soon as I try it in the browser, it works fine. In the end, I want to be able to fetch data stored…
jonsken
  • 111
  • 1
  • 11
1
vote
1 answer

Loading large CSV file with Papaparse not working (only first chunk loaded)

I would like to load a local file (client-side) with papaparse into my React application. Unfortunately, it only loads the first chunk but never the whole file. My file contains about 500 rows and there are never more than 300 rows loaded. It seems…
Jenny
  • 11
  • 1
1
vote
1 answer

Papaparse with chart.js not displaying csv value on the x axis

Currently using papaparse 5.1 and chart.js 3.5.1 together to display 15 min intervals on X axis. This was working in v2 of chart.js but now it won't display 'Time' value of csv on the chart anymore. Instead it is showing 0,2,4,6,8,…
mikez
  • 35
  • 4
1
vote
1 answer

Papa Parse: How to catch error if remote CSV is inaccessible?

When using Papa Parse, you can access CSV errors via result.errors within the complete callback, but how do I catch error if remote CSV is inaccessible (e.g. 404)? Papa.parse(csv_remote_url, { download: true, header: true, complete:…
iamkeir
  • 3,222
  • 2
  • 21
  • 22
1
vote
1 answer

Saving data from a CSV in a global variable (fast-csv/papaparse)

I am new to js and trying to parse a CSV in the backend using node.js. I have an array of states in which I want to store the data of a column of CSV. This is a very simple code that i wrote using fast-csv to do so. But whenever I run the code, I…
Nitish
  • 15
  • 5
1
vote
1 answer

how to change the text color of table data in tr.append($(""

I would like to see table data Status text color is red when it is Active and green when it is Inactive. I tried many different ways but failed. Any helpful suggestions will be appreciated. Thanks for your time and effort. How is it possible? HTML…
Hemjal
  • 130
  • 2
  • 7
1
vote
1 answer

CSV data to html using id with papa.parse and js

I'm new to this just a bit, especially with js and using papa parse. My goal is to create an HTML chart using a CSS grid rather than HTML table tags. But I'm getting the div's printing "undefined", but in my actual google sheet, there are values. …
mjl
  • 40
  • 5
1
vote
1 answer

Trying to use react-papaparse to stream a local file row by row but it's not working - am I coding it correctly or is it just not possible?

I can use react-papaparse to parse a local file triggering onFileLoad={this.handleOnFileLoad} ok, but I'd like to stream it, so I tried the code below, trying to pass onStep or step in props but its not triggering. The documentation implies it's…
1
vote
0 answers

Array.push doesn't working with the return from a method

I'm parsing a CSV with Papaparse, adding a new column of information in the CSV and creating a table with it. I have a method which retrieves the information that I want to add in the CSV and I need to push the return of this method in order to…
A. Curvina
  • 31
  • 3