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

Unable to use PapaParse 'unparse' to convert JSON to CSV

I am trying to use babyParse to convert a JSON object to CSV and output the resulting csv format to a file on the system. module.exports.downloadItemCsv = function(req, res){ Item.find({}) .sort({date:-1}) .exec(function(err,…
ricky89
  • 1,326
  • 6
  • 24
  • 37
0
votes
1 answer

unable to parse csv to json using Baby Parse

I am trying to use baby parse (branch off of Papa Parse) to take a csv file and parse the data to Json. The csv file I am testing is very straight forward: Column1,Column2,Column3 1,2,3 3,2,1 So far I am successfully loading the file using…
ricky89
  • 1,326
  • 6
  • 24
  • 37
0
votes
0 answers

Why use both workers and streaming together in Papa Parse?

I used papa parse initially with workers enabled to avoid locking the browser thread. However, now that I'm using streaming the browser thread doesn't lock even with workers disabled. I'm confused as to why? What reason would someone want to use…
SteveDeFacto
  • 1,317
  • 4
  • 19
  • 35
0
votes
1 answer

PapaParse - Can't use data after parsing

Looking to use the data in a CSV to create a network graph. Kinda stuck at the first hurdle as I want to create an array of arrays from the CSV using PapaParse, however can't seem to push the data from papaParse into my array, all I get is an empty…
ThallerThanYall
  • 197
  • 2
  • 14
0
votes
2 answers

Content read in from a .csv file occasionally not showing up on page load

So I'm working on a personal portfolio for myself with a few projects I've done for my intro web dev class. Since we've been practicing data driven content websites and webapps in class, my professor wanted us to do something similar, either by…
user5588594
0
votes
2 answers

Callbacks in JavaScript

A rookie question, but I am trying to understand how PapaParse (or anything else, for that matter) uses callbacks. When I use the following code: Here is the revised full code:
Tyler330
  • 395
  • 2
  • 6
  • 15
0
votes
0 answers

Papa Parse csv to object, 1 million rows by 10 columns, Chunk function

I'm trying to parse the data in my csv with Papa Parse, but the returned object is only 50,000 of the million rows. I attempted to use the chunk callback function to break up the file into smaller components, but haven't had any luck because I don't…
user3014093
  • 389
  • 2
  • 5
  • 20
0
votes
1 answer

I am getting undefined with Papaparse

So when I try to read the variable on complete with papaparse i get the following error: TypeError: wpcc_results is undefined. I really cannot see what is wrong with my code here: $('.wpcc_gen_box_form').submit(function(event) { …
Tapha
  • 1,491
  • 3
  • 17
  • 32
0
votes
1 answer

how to Papa.unparse a huge JSON object

I'm using Papa.unparse() to convert a JSON object to csv then downloading the file. The method fails with: "allocation size overflow papaparse.min.js:6:1580" This happens in firefox when there's > than 500,000 items to unparse in the JSON array. The…
Joel
  • 46
  • 1
  • 4
0
votes
2 answers

Using papaparse after loading script dynamically

ORIGINAL I'm loading Papaparse on the fly in my Javascript app like this: $.getScript('path/to/papaparse.js',function() { //below script }); Then I get the file for parsing like this. $('#csv_file').parse({ delimiter: ",", worker:…
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69
0
votes
0 answers

Can i use papa parse to increase the loading time of highcharts for large files?

HIghcharts couldn't load large csv files so can i use papa parse to increase the loading and response time of the chart? $(function () { $.get('<%= @wire.attachment %>', function(csv) { $('#container').highcharts({ chart: { type: 'area',…
0
votes
1 answer

Regex Delimeter in PapaParse

I wish to ask, is it possible to use regexes as delimiters in PapaParse? Something like: Papa.parse(string, { delimiter:regex } ); I am trying to match a specific pattern of CSVs like so: /([A-Za-z]{2}[0-9]+,?)/g i.e. I want exactly 2…
PiMan
  • 55
  • 10
0
votes
1 answer

Unable to get file for parsing

Background: I have downloaded and stored some files on my phone. I want to retrieve these files one after another and parse them individually. The results from the parsing are used for further calculations. Problem: The files are not getting…
Pallavi Prasad
  • 577
  • 2
  • 9
  • 28
0
votes
2 answers

How to use Papa Parse for javascript csv parsing

I looked at their API but didn't have any success with it. I'm trying to parse some csv files that are being sent to the client when he enters the server. I tried this code: // Parse local CSV file Papa.parse("data/premier league/14-15s.csv", { …
Eivind
  • 301
  • 6
  • 18
0
votes
1 answer

Before callback, how to use?

I am looking for help to understand how to use the before callback of Papaparse parser. In the doc, it is written: before is an optional callback that lets you inspect each file before parsing begins. Return an object like: { action:…