Bunlong / react-papaparse

react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
https://react-papaparse.js.org
MIT License
363 stars 60 forks source link

convert uploaded csv to json is not working #170

Open sudipzoom opened 2 months ago

sudipzoom commented 2 months ago

Hi Author/ contributors, converting a uploaded csv to a json array (header :value ) is not working with readString. I needed to introduce extra methodology for the conversion.

onUploadAccepted={(results,file) => handleFileAccepted(results,file)}

function handleFileAccepted(data,file){

}

In above method data is used to show tables on screen using react-papaparse file is used to read the event.target.results as blob by filereader and then parse that into a readable json array for backend use. here I could not able to use your pacakge react-papaparse.

It is not at all clear that how readString works. I tried a lot but readString always gives me bunch arrays(header arrays, value arrays) . However I request you to clearly mention in docs how does readString work though I did this using another method but it will be helpful for new users if they could utilize the same package. Thanks.