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

Can't reach results of Papa Parse outside the 'complete' function

I am currently using Papa Parse with Angular 2 to load a csv list into a list and I want to be able to pass that list through to another component. I am able to read the csv data and print them with a console log but I am unable to address the…
2
votes
2 answers

Convert Papaparse rows to objects

Does papaparse support return an array of object instances that are keyed by the header columns? For example I have a CSV file like this: sku, location, quantity 'sku1', 'Chicago', 3 'sku2', 'New York, 4 I'd like the array returned by papaparse to…
Ole
  • 41,793
  • 59
  • 191
  • 359
2
votes
0 answers

Parse a local CSV file in javascript

I am trying to parse a simple csv file in javascript. I've seen some questions in Stackoverflow, but the solutions are having a input field in the html body. But I want to read the data from local disk directly in the javascript. I've googled and…
2
votes
1 answer

Parsing local CSV file using Papaparse in Cordova iOS

I'm using Papaparse and I'm trying to parse a CSV file which is saved in a folder within www. It works well with android and browser platform. However, when it comes to iOS, it returns the error callback. When I output the error, it returns…
dariru
  • 501
  • 6
  • 16
2
votes
1 answer

Javascript parsing text data error?

I'm trying to parse some data from my local directory. I use papa parser to do it. The problem is I can't assign text file into a variable. I'm getting this error ; Uncaught TypeError: Failed to execute 'readAsText' on 'FileReader': parameter 1 is…
Capan
  • 686
  • 1
  • 14
  • 32
2
votes
0 answers

Objects being added to separate arrays instead of pushed to single array (PapaParse)

I am trying to push all of my JSON objects to one array using Papa Parse however I am only able to push them to separate arrays at the moment. As you can see I am converting a CSV file into JSON. Here is my code: var myRows =…
Nicholas Maddren
  • 155
  • 5
  • 12
2
votes
1 answer

Can files be updated and read using the JavaScript FileReader interface?

I am reading a local CSV file using a web UI, and the HTML5 FileReader interface to handle the local file stream. This works great. However, sometimes I want the file being read to be updated continuously, after the initial load. I am having…
Jeff Fohl
  • 2,047
  • 2
  • 23
  • 26
2
votes
1 answer

Papa Parse is too fast

I am using Papa Parse to read CSV files that usually have many duplicate rows. Through the STEP callback, each row is POSTed to an API that checks if the row is a duplicate before adding it to a MySQL database. The problem is, Papa Parse fires the…
Tim
  • 117
  • 1
  • 9
2
votes
1 answer

Using data from Papaparse callback function

I am probably getting it all backward, and I am afraid I haven't done much javascript for a long time and things have changed quite a bit since then. The answer may thus be very trivial, but I wasn't able to find anything useful online. Very simply,…
2
votes
1 answer

Angular algorithm: stop ngFileUpload double looping?

I have a controller: app.controller('FileUploadController', ['$scope', 'Upload', '$timeout', function ($scope, Upload, $timeout) { $scope.$watch('files', function () { $scope.upload($scope.files); }); $scope.$watch('file',…
2
votes
3 answers

Use Asynchronous IO better

I am really new to JS, and even newer to node.js. So using "traditional" programming paradigms my file looks like this: var d = require('babyparse'); var fs = require('fs'); var file = fs.readFile('SkuDetail.txt'); d.parse(file); So this has many…
Reenen
  • 128
  • 9
2
votes
1 answer

Download multiple files using PapaParse?

I'm using PapaParse to download CSV files from my JavaScript scripts and it's working great. However, I've got a page where I need to download two files and only then do some work, and I was wondering if there was a neater way to do this than…
Richard
  • 62,943
  • 126
  • 334
  • 542
2
votes
1 answer

referencing papaparse output arrays

I'm using papaParse to parse a CVS file. Then I want to use specific data from arrays but don't know how to reference it. I can see it in console like this: Object { data: Array[15], errors: Array[0], meta: Object } index.html:42:12 this is my code…
Miha Šušteršič
  • 9,742
  • 25
  • 92
  • 163
2
votes
4 answers

PapaParse with Angular JS

Liked the nice CSV parser & unparser of PapaParse. Can any one help me to get this combine with Angular JS. I like to make PapaParse work in Angular Way. Trying for a solution.
Felix
  • 245
  • 2
  • 10
2
votes
1 answer

PapaParse not working (returns empty array)

I am trying to parse a variant of this file (instead of using tab as delimiter I am using a file that has comma as delimiter) https://github.com/materechm/Schizophrenia/blob/master/GWAS.txt This is my code, but I am getting an empty array and no…
user3089079
  • 59
  • 1
  • 7