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
7
votes
4 answers

PapaParse returns undefined when reading CSV

My goal is to open a CSV file, then parse its contents onto a
using PapaParse. So far it seems to be working but instead of actual values it just returns undefined. I have no idea what's wrong, could be a strange CSV file (I made this from an…
Miha Šušteršič
  • 9,742
  • 25
  • 92
  • 163
6
votes
2 answers

How to import local csv file into vue using vue-papa-parse?

I have a vue project, where I want to select a local .csv and import the contents to a variable. I'm trying to do so via vue-papa-parse, which I've installed via npm. The following code (main.js, then a vue component) selects a file in browser but…
Russell
  • 131
  • 1
  • 4
6
votes
4 answers

How do I import a csv into chart.js?

I have been looking for this solution but can't seem to find it . Does chart.js support this ? I have attempted to parse in the data with papaparse, but due to my limited knowledge I can't find a solution.
Nick
  • 195
  • 1
  • 3
  • 13
5
votes
4 answers

JavaScript, Papaparse, return array of objects

I'm using to Papaparse to convert a csv file to json object. The API expects the data in this way: "data": [ { "id": 1, "nombre": "AGUASBLANCAS-AGB", "descripcion": "-", "it_unidad_generadora":…
pmiranda
  • 7,602
  • 14
  • 72
  • 155
5
votes
2 answers

Papa Parse CSV for React Native

Using PapaParse, I am trying to parse a CSV located locally on an iOS device. The sample code below is pretty straight forward except that it does not take a file path. I do have the path to the local file but I'm not sure how properly insert that…
pnizzle
  • 6,243
  • 4
  • 52
  • 81
5
votes
1 answer

Add header to object or csv string

I'm using Papaparse with my csv (no header) string to give me an array of objects. I can parse the string without a header then change the keys or I can add a header string to my csv string and then parse that. I haven't had luck with either…
Bum Son
  • 89
  • 1
  • 7
5
votes
1 answer

ChartJS: Uncaught TypeError: Cannot read property 'call' of undefined

I am using ChartJS to render some data parsed from a CSV. The CSV parses fine--I can verify this with console logs and other methods. I then generate the array to feed ChartJS programmatically. This array also looks fine to me in the console, but…
Katori
  • 101
  • 2
  • 8
5
votes
2 answers

How to rearrange CSV / JSON keys columns? (Javascript)

I am converting a JSON object array to CSV using Papa Parse JavaScript Library. Is there a way to have the CSV columns arranged in a certain way. For e.g; I get the column as: OrderStatus, canOp, OpDesc, ID, OrderNumber, FinishTime, UOM,…
Shahzad Ali
  • 53
  • 1
  • 5
5
votes
2 answers

Not able to hardcode file directory for CSV parsing using Papa Parse

I am trying to parse a .csv file that will be in an already known local directory using Papa Parse in Javascript. If I have a mechanism to ask the user to browse for the file, it works like a charm. But I can't figure out how to get it to…
YazanLpizra
  • 520
  • 1
  • 11
  • 32
5
votes
2 answers

PapaParse Errors explanation

I'm using papaParse to parse an CSV file into JSON for further use. Upon parsin it returns "errors": [ { "type": "FieldMismatch", "code": "TooFewFields", "message": "Too few fields: expected 21 fields but parsed 1", "row": 14 } ], "meta": {…
Miha Šušteršič
  • 9,742
  • 25
  • 92
  • 163
4
votes
5 answers

How can I use papaparse on Node JS?

I have been trying to get papaparse running on nodejs for a very long time now and I keep failing. I want to try to load my local CSV and then give this papaparse? How to do that? My code does not work. import papa from "papaparse"; import fs from…
redlightfilms
  • 193
  • 1
  • 4
  • 13
4
votes
2 answers

Fetching a Google Sheet csv file yields CORS error

I try to tech data from a Google spreadsheet using this code function init() { Papa.parse(public_spreadsheet_url, { download: true, header: true, complete: showInfo }) } This yields the following CORS error: Access to…
jak
  • 184
  • 7
4
votes
2 answers

How to get Papa.parse results into an array

Forewarning, I am new to js and I crafted the code below was taken from Retrieve parsed data from CSV in Javascript object (using Papa Parse) my goal = parse a csv file into an array, and use that array in a few other operations. I can see that the…
swv
  • 691
  • 1
  • 12
  • 28
4
votes
1 answer

Usage of Papaparse with Angular 2: Cannot find name 'Papa'

I am working on a project where I upload a csv file and parse it to view the results in a list. Everything worked fine untill I deleted my node_modules to re-install them to get rid other errors. When I did npm updated my node modules again the…
4
votes
3 answers

Papa Parse single column error Unable to auto-detect delimiting character; defaulted to ','

I have a csv where only one column exists and I am using Papa Parse library to parse the csv. I receive the following error Unable to auto-detect delimiting character; defaulted to ',' Since it is only a single column it is not comma separated…
pantonis
  • 5,601
  • 12
  • 58
  • 115
1
2
3
27 28