leftshifters / excel-parser

nodejs wrapper for parsing spreadsheet.
MIT License
72 stars 70 forks source link

records is empty if parse is called more that on time #26

Open tlfbrito opened 9 years ago

tlfbrito commented 9 years ago

If I call parse more that one time for different worksheets, I get an empty records in the first call.

  inFile: 'my_file.in',
  worksheet: 3,
  skipEmpty: true,
  searchFor: {
    term: ['my serach term'],
    type: 'loose'
  }
},function(err, records){
  if(err) console.error(err);
  console.log(records); // empty
});

excelParser.parse({
  inFile: 'my_file.in',
  worksheet: 1,
  skipEmpty: true,
  searchFor: {
    term: ['my serach term'],
    type: 'loose'
  }
},function(err, records){
  if(err) console.error(err);
  console.log(records); // as expected 
});
srmor commented 9 years ago

Your first call is reading from a different worksheet than the second call. Does worksheet 3 have anything in it?

tlfbrito commented 9 years ago

Yes it has. This is actually related with https://github.com/leftshifters/excel-parser/issues/18 Because it works with @lsborg solution

srmor commented 9 years ago

Ah ok.