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
372 stars 62 forks source link

How to use config options with readRemoteFile? #4

Closed Quafadas closed 4 years ago

Quafadas commented 4 years ago

I can't get this to work.

Any hints?

` const configOptions = {header: true, dynamicTyping: true};

    readRemoteFile(
        default, configOptions,
        {
            complete: function (results) {
                console.log(results);
                console.log(results.data[0]);
                console.log(results.data[1]);
            }
        }
    )`

Gets me back data with the header in ...

Bunlong commented 4 years ago

@Quafadas please try the following format. Thanks!

readRemoteFile(bigFileURL, {
    worker: true,
    header: true,
    dynamicTyping: true,
    complete: function(results) {
        console.log(results)
    }
})
Bunlong commented 4 years ago

@Quafadas if it work please kindly let us know. Thanks!

Quafadas commented 4 years ago

Yes!

Worked great. Thanks :-).

Bunlong commented 4 years ago

@Quafadas You are very welcome. Thanks :-)