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

Typescript papaparse No overload matches this call

I use Papaparse lib in typescript. import Papa from 'papaparse'; Papa.parse(filePath, { download: true, header: true, dynamicTyping: true, skipEmptyLines: true, }; filepath type is string I get error on filePath: No overload matches this…
Hasina Njaratin
  • 401
  • 1
  • 6
  • 17
2
votes
1 answer

Papaparse unparse config delimeter

I don't understand the documentation of Papaparse unparse config. The docs say on https://www.papaparse.com/docs#json-to-csv to unparse like this Papa.unparse(data[, config]) So far I managed to generate a CSV with a header and write it to the file…
SaHeinem
  • 358
  • 1
  • 3
  • 10
2
votes
1 answer

Adding different point style to each column from parsed csv in chart.js

I'm trying to use the parsed csv to specify a pointStyle color for each column dataset. Right now this will cause alternating colors of points on the line chart. Would splitting out the 'borderColor:' into three if statements of "i equal to the…
mikez
  • 35
  • 4
2
votes
1 answer

what is the limit of the file size that papa can parse?

this.papa.parse(this.inputFile, { header: false, dynamicTyping: true, skipEmptyLines: true, error: (error) => { console.log('parse_error: ', error); }, complete: (result) => { data = result.data; …
2
votes
0 answers

Does react-papaparse support accepting/rejecting file types

I'm using react-papaparse to upload local .csv files. On a Mac, only .csv files are enabled. On a Windows all file types are available. Is there a way to only allow .csv file types across all operating systems? I didn't see this as a config option…
Adam Bradbury
  • 91
  • 2
  • 11
2
votes
1 answer

How do I import PapaParse (or any js library) into a JavaScript File?

I am completely new to working with JavaScript libraries, but I can't seem to figure out what I am doing wrong here. I am building a browser extension using JavaScript, and I need to be able to parse through a .csv file that I am using as a…
MRB
  • 221
  • 2
  • 12
2
votes
1 answer

How to import a CSV file in ReactJs?

I am trying to import a csv file that is in a folder called data on the same level as this function. I've tried to incorporate the solution I found on here, but no luck and I don't know what I need to modify. getData.jsx import React, { useState,…
Winsome
  • 79
  • 1
  • 5
  • 12
2
votes
1 answer

React Leaflet first object is undefined in a useState case for drawing map markers

I am trying to loop through an object that has been parsed from a CSV file of Locations, and Lat/Lng pairs. But when I loop through this object, the first loop returns my object with all the values as undefined. My code is as follows: import React,…
ljm222
  • 47
  • 5
2
votes
1 answer

How to return Papa-parsed CSV via promise/async-await

Can someone help me understand why this returns a pending promise, rather than the data? async function toJson (filepath) { const file = fs.createReadStream(filepath) let json = new Promise((resolve, reject) => { Papa.parse(file, { …
mthelm85
  • 121
  • 3
  • 10
2
votes
1 answer

Papa Parse first header field rendered with quotes

I am running papa parse on the server to read and parse a csv file usign the following code: function getData() { console.log("Started getData..."); const file = fs.createReadStream(filePath); papa.parse(file, { header: true, …
Paul
  • 813
  • 11
  • 27
2
votes
1 answer

Displaying each data line by line during AJAX CSV File Upload

I am using papaparse, Jquery AJAX, PHP and have successfully finished the parsing of csv, However, I would like to display data while my CSV file is being uploaded. Here is a bit of my code; var xhr_file =…
Nathaniel
  • 29
  • 2
2
votes
1 answer

how to download a csv generated from papaparse?

I have successfully managed to unparse a json to csv using papaparse. I have stored the generated csv in a variable. On a button click, the csv is being generated and I can see the result in my console. I want to download that csv generated into my…
Salman
  • 393
  • 1
  • 7
  • 23
2
votes
3 answers

Remove unwanted columns from CSV file using Papaparse

I have a situation where a user can upload a csv file. This CSV file contains a lot of data, but I am only interested in 2 columns (ID and Date). At the moment, I am parsing the CSV using Papaparse Papa.parse(ev.data, { delimiter: "", …
katie hudson
  • 2,765
  • 13
  • 50
  • 93
2
votes
1 answer

Angular 4 function loses context using papaparse

I have the following code httpcsv2Array(event) { var gethttpcsv = Papa.parse('https://docs.google.com/spreadsheets/d/e/yadyada/pub?output=csv', { download: true, header: true, …
Trevor
  • 67
  • 5
2
votes
3 answers

How to specify a tab delimiter in PapaParse?

I receive a delimiter like so: var delimiter = process.argv[3]; if (!delimiter) { console.log('Please specify a delimiter as the second argument in the CLI'); process.exit(0); } console.log('with delimiter:', delimiter); And I attempt to use it…
pulkitsinghal
  • 3,855
  • 13
  • 45
  • 84