I am using PapaParse to parse multiple CSV files. The file selector has them in the order of A B C D E, but they aren't always parsed in that order. I understand that it is because PapaParse will finish up with one file before another, but it is crucial that I parse them in the order that they appear from the file selector i.e. alphabetical.
var Files = $('input[id="upload"]')[0].files;
var allProcessed = [], allDates = [];
for (i in Files)
{
const date = new Date(Files[i].lastModified);
allDates.push((date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear());
Papa.parse(Files[i],
{
skipEmptyLines: true,
complete: function(results)
{
allProcessed.push(results);
if (allProcessed.length == Files.length)
{
console.log('all done');
}
}
}
}