StackAsk is a community where developers ask questions, share answers and learn from each others real-world experience, so every solved problem helps the next person who runs into it.
<span>public</span> <span>static</span> <span>void</span> readXSSF(String filePath) <span>throws</span> IOException { <span>final</span> InputStream ExcelFileToRead = <span>new</span> FileInputStream(filePath); <span>final</span> XSSFWorkbook wb = <span>new</span> XSSFWorkbook(ExcelFileToRead); <span>final</span> Sheet sheet = wb.getSheetAt(<span>0</span>); Row row; Cell cell; <span>final</span> Iterator<Row> rows = sheet.rowIterator(); <span>while</span> (rows.hasNext()) { row = rows.<span>next</span>(); <span>final</span> Iterator<Cell> cells = row.cellIterator(); <span>while</span> (cells.hasNext()) { cell = cells.<span>next</span>(); <span>if</span> (cell.getCellType() == CellType.STRING) { System.out.<span>print</span>(cell.getStringCellValue() + <span>'t'</span>); } <span>else</span> <span>if</span> (cell.getCellType() == CellType.NUMERIC) { System.out.<span>print</span>(cell.getNumericCellValue() + <span>"t"</span>); } } System.out.<span>println</span>(); } System.out.<span>println</span>(<span>"Already read all. "</span>); }
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click