I am using PapaPase to parse big CSV file, using chunk mode.
I am validating csv data, and I want to stop streaming when validation fails.
But I am unable to stop streaming, after some parsing.
I tried to stop using return false from chunk callback, but it's not working.
Below is the code.
$("#fileselect").on("change", function(e){
if (this.files.length) {
var file = this.files[0]
count = 0;
Papa.parse(file, {
worker: true,
delimiter: "~~",
skipEmptyLines:true,
chunk: function (result) {
count += result.data.length;
console.clear();
console.log(count);
if (count>60000) {
return false;
}
},
complete: function (result, file) {
console.log(result)
}
});
}
});