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
37
votes
5 answers

How can I read a local file with Papa Parse?

How can I read a local file with Papa Parse? I have a file locally called challanges.csv, but after many tried I can't parse it with Papa Parse. var data; Papa.parse('challanges.csv', { header: true, dynamicTyping: true, complete:…
adamb
  • 793
  • 1
  • 11
  • 20
20
votes
3 answers

How to use Promises with PapaParse?

PapaParse has an asynch callback function for its API. I was wondering how I can convert it to a promise. For eg: Papa.parse(fileInput.files[0], { complete: function(results) { console.log(results); } }); Any help would be…
thehelpofgreat
  • 201
  • 1
  • 2
  • 3
15
votes
3 answers

Is PapaParse adding an empty string to the end of its data array?

Papa Parse seems wise, but I think he might be giving me null. I'm just: Papa.parse(countries); Where countries is a string containing the XMLHttpRequest of the countries csv file from a timezone database here: https://timezonedb.com/download But…
kidconcept
  • 509
  • 6
  • 13
13
votes
7 answers

Parse Remote CSV File using Nodejs / Papa Parse?

I am currently working on parsing a remote csv product feed from a Node app and would like to use Papa Parse to do that (as I have had success with it in the browser in the past). Papa Parse Github: https://github.com/mholt/PapaParse My initial…
Necevil
  • 2,802
  • 5
  • 25
  • 42
10
votes
2 answers

Download/Save CSV file - PapaParse

PROBLEM: Downloaded CSV file is blank (unparse() method to conver array/JSON to CSV). DETAIL: Papaparse is working fine when parse CSV file to JavaScript array. But when I feed that array data or JSON data to unparse() method, its not…
BetaDev
  • 4,516
  • 3
  • 21
  • 47
10
votes
2 answers

Get just header from remote csv file using papa parse

I need to extract just the header from a remote csv file. My current method is as follows: Papa parse has a method to stream data and look at each row individually which is great, and I can terminate the stream using parser.abort() to prevent it…
Single Entity
  • 2,925
  • 3
  • 37
  • 66
10
votes
2 answers

Change CSV headers while processing papaparse

Is it possible to change the headers of a "csv" file to uppercase during the process performed by papa.parse using JavaScript?! Thanks in advance.
Biryukov Pavel
  • 397
  • 4
  • 18
9
votes
2 answers

using papa parse for big csv files

I am trying to load a file that has about 100k in lines and so far the browser has been crashing ( locally ). I looked on the internet and saw Papa Parse seems to handle large files. Now it is reduced down to about 3-4 minutes to load into the…
Keith
  • 4,059
  • 2
  • 32
  • 56
8
votes
1 answer

Using PapaParse transformHeader to remove whitespace from headers?

If we have a CSV file like this: `firstName, lastName Jim, Carrey Stephen, Colbert` Papaparse will output the dynamically typed result like this: {firstName: 'Jim', ' lastName': '30000'} In order to just get {firstName: 'Jim',…
Ole
  • 41,793
  • 59
  • 191
  • 359
8
votes
1 answer

Error: Can't resolve 'stream' in .... papaparse

Im getting this error using ngx-papaparse in angular. It was working, I then tried adding jquery to my project, and in the process was warned of security issues, so I followed instructions and tried npm audit fix. In the process something seems to…
Jim Willey
  • 81
  • 1
  • 2
8
votes
2 answers

Displaying CSV Headers using PapaParse Plugin

I am using the PapaParse plugin for csv files. I have this function below that creates a table to display the CSV results. function handleFileSelect(evt) { var file = evt.target.files[0]; Papa.parse(file, { header: true, dynamicTyping: true, …
VIDesignz
  • 4,703
  • 3
  • 25
  • 37
7
votes
2 answers

How to stop papaparse streaming after some results

I am using PapaPase to parse big CSV file, using chunk mode. I am validating csv data, and I want to stop streaming when validation fails. But I am unable to stop streaming, after some parsing. I tried to stop using return false from chunk…
7
votes
3 answers

How to extract data to React state from CSV file using Papa Parse?

I'm using Papa Parse to parse a CSV file for Graphs. I want to store the data in React state after the file is parsed. Papa.Parse() doesn't return anything and results are provided asynchronously to a callback function. Also, setState() doesn't work…
Amanshu Kataria
  • 2,838
  • 7
  • 23
  • 38
7
votes
1 answer

Chart.js - Draw bar chart with multiple labels

I am trying to draw a bar chart with chart.js that uses multiple labels so that I can manipulate them. I have managed to do it with a line chart and tried extending what I did there with no luck. I am getting this error. what could be causing it?…
sf8193
  • 575
  • 1
  • 6
  • 25
7
votes
2 answers

How to import PapaParse with Browserify to inject into a controller?

I'm trying to import PapaParse and use it inside a controller. This is what i tried so far: import Papa from 'papaparse'; //import 'papaparse'; (tried it like this also) angular.module('app').constant('Papa', window.Papa); I think this is the…
passatgt
  • 4,234
  • 4
  • 40
  • 54
1
2 3
27 28