faisalman / simple-excel-js

SimpleExcel.js - WIP client-side script to parse / convert / write XML / CSV / TSV / HTML / JSON / etc formats.
http://faisalman.github.io/simple-excel-js/
190 stars 74 forks source link

Reading 2 csv files #1

Closed Bharat90 closed 9 years ago

Bharat90 commented 9 years ago

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

faisalman commented 9 years ago

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.