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

how to read local CSV file in Vue.js 3 using papa-parse

what I wanna do is to read csv file(which is in my directory) in vue.js what i tried first was import Papa from "papaparse"; import csvFile from "../../../assets/files/mediList.csv"; Papa.parse(csvFile, { download: true, encoding: "UTF-8", …
YESSS
  • 31
  • 4
1
vote
1 answer

Using papaparse to parse a CSV file with Javascript in a React app

I have a CSV file in the same directory as my React app that I am trying to read with Javascript. I am using Papaparse to parse the CSV file. Here is my code: Papa.parse("./headlines.csv", { download: true, complete: function(results, file)…
Bob Brown
  • 144
  • 16
1
vote
1 answer

How to exclude row from CSV with Papaparse

I have a CSV file and I used Papaparse to parse my data from it to a table in HTML. But I would like to exclude a row from my file; This is how it's written the CSV file: "Name";"Email";"Telephone" "[Lista] E.D. Elettronica Dedicata";"";"" "Andrea…
nano
  • 65
  • 6
1
vote
0 answers

papaparse not reading row during step if there's a delay in the function

So, my code looks like this: Papa.parse(my_local_file, { step: async function(row, parser){ console.log('starting wait'); await new Promise(res => {setTimeout(() => {res(7)}, 10000)}); …
machupiccu
  • 45
  • 4
1
vote
1 answer

How to import Papaparse

I have a Svelte/Js/Vite app and need to import Papaparse. It's installed as npm install papaparse and is present in the package.json. When I import it as import * as Papa from "papaparse";, methods are not visible in the IDE (i.e. parse()) and the…
Dmitry
  • 727
  • 1
  • 8
  • 34
1
vote
0 answers

Table rows show up as undefined in a function - HTML + JS

Attempting to sort a table by clicking the headers as found on W3Schools: https://www.w3schools.com/howto/howto_js_sort_table.asp However, the table is created from a spreadsheet and in a separate function. rows = coasterTable.rows; returns as…
Watkin81
  • 11
  • 2
1
vote
0 answers

Using react-papaparse in the Next.js getStaticProps - XMLHttpRequest is not defined

I am trying to use papaparse inside my Next.js page. I am using react-papaparse package which is a React wrapper for Papaparse. I am trying to parse remote CSV file inside getStaticProps() function but the error I get is XMLHttpRequest is not…
Primoz Rome
  • 10,379
  • 17
  • 76
  • 108
1
vote
1 answer

How to create a React JS object from a CSV File (CSV Parsing/Papaparse)

I cannot figure out how to parse a CSV file into an array which can be displayed in React JS. I tried using PapaParse and react-papaparse, but neither allowed me to return the csv as an array. This is essential in React JS because the way components…
Jack N
  • 324
  • 2
  • 14
1
vote
0 answers

Error when trying to load local csv file in Vue3 app

I am trying to load a local CSV file with papaparse to extract it's content in a Vue3 application. When I try something like: let myTest = Papa.parse("@/assets/data/postcodes.csv", { delimiter: ",", header: true …
tanbog
  • 600
  • 9
  • 28
1
vote
0 answers

paparse showing extra object after parsing csv file data

I'm Using paparse to parse csv file data into json format , it is working fine , but whenever i we paparse parse the csv file data into jason array of objects , it shows extra object with null values, for example , if we upload csv with 4 records ,…
1
vote
0 answers

How to stream a large CSV file on server-side using PapaParse without Node.js?

I would like to read a large, local CSV file in chunks using Papa parse in JavaScript, so that the application doesn't get stuck while the file is read. By "local" I mean that the file is on the server-side, accessible to javascript (it's not coming…
user20c
  • 31
  • 2
1
vote
2 answers

How can I execute one for-loop function, then call another function after the for-loop function is complete with a button?

I am trying to run a function after parsing some CSV with Papaparse on button click. I can only make it work with two buttons which is not the best. I actually have some more code that will update the selected_csv array with push() method. What I…
1
vote
0 answers

NodeJS s3 zip/csv download, can't read file

i'm using AWS's developer Reporting API in order to download a zip file containing a CSV sales report. My problem is, I cannot read this file and i can't for the life of me figure out why. Whilst on the server terminal, cat my.csv prints the file…
J.E.C.
  • 2,616
  • 2
  • 18
  • 21
1
vote
0 answers

papaparse csv to json nested array

I have a CSV file which has image[0].url,image[1].url like headers. I want it to be a nested element as below. By parsing the CSV to JSON with papaparse, is there anyway i can do that? "image": [ { "url":…
1
vote
1 answer

Propper way to handle csv's in nextjs + typescript

I'm building a web app with nextjs & typescript. I have a chart which I want to display and would like to use a csv file for the data (let me know if using csv is a bad choice - I guess in the end I will probably add this data to my backend server…
sev
  • 1,500
  • 17
  • 45