Is it possible to read the two csv files by creating one parser within another. I am not able to handle something like this:
var csvParser = new SimpleExcel.Parser.CSV();
var fileInput = document.getElementById('fileInput'); //taking file from user
var file = e.target.files[0];----->I couldnot understand what this does. Could you explain this
csvParser.loadFile(file, function () {
var csvParser2 = new SimpleExcel.Parser.CSV();
var rankInput = document.getElementById('rankInput'); //taking file from user
var file2 = e.target.files[0];
csvParser2.loadFile(file2,function(){
second_parser={r:csvParser2.getSheet()[i][1], g:csvParser2.getSheet()[i][0]};
console.log(csvParser2.getSheet());
});
});
When I read the output using console.log, the first file is read and not the second. Could you let me know if I am making a mistake?
Hi Bharat90, if you have any question regarding the javascript please post it on stackoverflow, as this github feature is for development-related only. Thank you.
Hi faisalman
Is it possible to read the two csv files by creating one parser within another. I am not able to handle something like this: var csvParser = new SimpleExcel.Parser.CSV(); var fileInput = document.getElementById('fileInput'); //taking file from user var file = e.target.files[0];----->I couldnot understand what this does. Could you explain this csvParser.loadFile(file, function () { var csvParser2 = new SimpleExcel.Parser.CSV(); var rankInput = document.getElementById('rankInput'); //taking file from user var file2 = e.target.files[0]; csvParser2.loadFile(file2,function(){ second_parser={r:csvParser2.getSheet()[i][1], g:csvParser2.getSheet()[i][0]}; console.log(csvParser2.getSheet()); }); });
When I read the output using console.log, the first file is read and not the second. Could you let me know if I am making a mistake?
Thanks and Regards Bharat