code: private void parse(Workbook ws) throws ParseException {
      LOG.info("Parsing XLS file...");
      Sheet sheet = ws.getSheet(SHEET_NAME);
      if (sheet == null) {
        sheet = ws.getSheetAt(0);
      }
      if (sheet == null) {
        throw new ParseException("No sheet found");
      }
  
      int firstRow = sheet.getFirstRowNum();
      int lastRow = sheet.getLastRowNum();
      LOG.info("first row is:" + firstRow + ", last row is:" + lastRow);
  
      // first row is expected to be the header.
      analyzeHeader(sheet.getRow(firstRow));
  
      for (int i = firstRow + 1; i <= lastRow; i++) {
        Row r = sheet.getRow(i);
        extractRowData(r, cellMap);
      }
      LOG.info("Parsing of XLS file finished.");
    }
docs: Parses a CSV file from a given reader.
  
  @throws ParseException if any parse errors ocur