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
4
votes
1 answer

Can the PapaParse "unparse" function work with varying headers?

I'm trying to use the PapaParse library (http://papaparse.com/) to convert JavaScript objects/JSON into a CSV file. Specifically in my case, each record may have different fields. I want the resulting CSV output to be an agregate of all fields for…
4
votes
1 answer

Papaparse proper encoding for strange characters

I am trying to read strange characters from a .csv file using Papaparse. Here is an example of some of the strange characters: ‡,œ,‰,Ž,etc When I read these with papaparse I get: �,�,�, etc regardless of if printed to console or into a .csv/.txt…
ProGirlXOXO
  • 2,170
  • 6
  • 25
  • 47
4
votes
2 answers

Papa Parse reading CSV locally

Can someone point to or show me a working example of Papa Parse reading a csv file. When I try to use : Papa.parse(file, { complete: function(results) { console.log("Finished:", results.data); } }); the file name is returned in the…
Sach
  • 75
  • 1
  • 10
4
votes
2 answers

Properly parsing local file with PapaParse

I need to parse some local files, and I found the PapaParse library. It seems to be necessary to have a instance of File to be able to parse local files. So I created this in my hmtl:
pceccon
  • 9,379
  • 26
  • 82
  • 158
4
votes
1 answer

Loading PapaParse dynamically with webpack

I am using PapaParse to load a csv file from a file input. Currently, I have a working version where I load PapaParse using a script tag: And handle the change…
robd
  • 9,646
  • 5
  • 40
  • 59
3
votes
1 answer

How to type the result of Papa.parse?

I'm using Papaparse with Typescript to parse a local file and it works well. I'm doing it like this: parse(file, { header: true, dynamicTyping: true, complete: (results) => console.log(results) }); But I want to strongly type…
Jad
  • 78
  • 6
3
votes
1 answer

Convert JSON to CSV using Papaparse

I have a Node JS and Typescript project in which I currently receive a JSON from an API and convert it into CSV format with a limit of lines, using the json-2-csv module. I have read that the papaparse module is quite fast for these things and I…
sirtz
  • 75
  • 2
  • 9
3
votes
1 answer

Papa parser to await for step

I was able to configure all in papa parser and it works well even with 200k items parsing. So I can process all the data and them await for each row in the result array. the problem is if I am using a step how I can make the step await the previous…
Ricardo Silva
  • 1,221
  • 9
  • 19
3
votes
1 answer

Papa parse is giving type error Object possibly null for File type input

I have a simple react component where I am using a HTML input (type='file') to upload files. I am using Papa Parse to parse the csv file to JSON. I am doing it with typescript. I have installed both @types/node and @types/papaparse. I would be…
Kishan Vikani
  • 105
  • 1
  • 9
3
votes
1 answer

Firebase Cloud FireStore: Insert Large Array

Disclaimer: I have been programming for about 4 months now, so I'm still very new to programming. I am using Firebase Cloud Firestore for a database and inserting CSV files with large amounts of data in them. Each file can be about 100k records in…
Iwan Pieterse
  • 543
  • 1
  • 4
  • 12
3
votes
1 answer

Understanding Papaparse with local file

I am trying to understand how to properly implement Papaparse with a local file. I have looked at a lot of online resources, and the approach they take is this loadTextFromFile (event) { if (!event.target.files[0]) { alert('Upload a…
katie hudson
  • 2,765
  • 13
  • 50
  • 93
3
votes
1 answer

Papa Parse with backslash escaping

I have input that people will probably say "that's not really CSV", but I still have to parse it. (using Papa Parse) comma is the delimiter. backslash is the escape. comma, double quote, backslash, r and n (to denote newlines) can all be…
Fuzzy
  • 190
  • 7
3
votes
3 answers

Papa parse returns Data array in which everything is converted to string

I am parsing .CSV to Papa.parse with React, i am getting output something like this: [ {Year: "1929", BMW: "1896", Toyots: "9547", Mercedes: "4881"}, {Year: "1930", BMW: "6548", Toyots: "4741", Mercedes: "8096"}, {Year: "1931", BMW: "5013",…
Jayraj
  • 390
  • 4
  • 16
3
votes
0 answers

How to get use papaparse with remote link in react-native?

what I have tried is as following. However, it kept show the error: 'Synchronous http requests are not supported'. import * as Papa from 'papaparse'; componentDidMount(){ let csvUrl =…
K.Kong
  • 31
  • 2
3
votes
0 answers

Papa Parse incorect column type

I have one column with for example 5/5 value and when i exporting this data to csv file result is date format (5-MAY). How can i change column type in config object? here is example data var data = [{count:'5/5'},{count:'23/5'}];
1 2
3
27 28