1

I am using SheetJS / XSLX / J to extract and parse JSON from Excel documents.

1.) I am facing the issue that in an Excel file I need to parse, I need to discard the 6 first rows.

2.) As an aside I am also facing the issue of extracting only the first sheet, and as it stands at the moment I am parsing all sheets, then accessing only the first one. This overhead I would like to reduce if possible

Code

 workbook = J.readFile(filefullpath);

 var tmpArray = J.utils.to_json(workbook)
 var first = function (obj) {
        for (var a in obj) return a;
      };
 var firstSheet = first(tmpArray);

 tmpArray[firstSheet].forEach(function(item) {
 // ... do stuff with item here
 }
Stephan Kristyn
  • 15,015
  • 14
  • 88
  • 147

0 Answers0