private void processWorkBook(InputStream inputStream) throws NumberFormatException, IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); String line = null; while ((line = bufferedReader.readLine()) != null) { for (String sheetTag : StringUtilities.multiFindBetween(line, "<sheet ", "/>")) { String name = StringUtilities.findBetween(sheetTag, "name=\"", "\""); String order = StringUtilities.findBetween(sheetTag, "sheetId=\"", "\""); String rId = StringUtilities.findBetween(sheetTag, "r:id=\"", "\""); Sheet sheet = rIdToSheet.get(rId); sheet.setName(name); sheet.order = Integer.parseInt(order); } } }
private void processSheet(String filename, ZipInputStream inputStream) throws IOException { Sheet sheet = filenameToSheet.get(filename); // System.out.println(filename + "\t" + sheet.name); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); String line; StringBuilder fullSheet = new StringBuilder(); while ((line = bufferedReader.readLine()) != null) fullSheet.append(line); for (String rowLine : StringUtilities.multiFindBetween(fullSheet.toString(), "<row", "</row>")) { Row row = new Row(); row.addAll(findCellValues(rowLine)); if (row.size() != 0) sheet.add(row); } }