import com.monitorjbl.xlsx.StreamingReader; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class ExcelReaderExample { public static void main(String[] args) { File file = new File("path/to/excel/file.xlsx"); try { InputStream is = new FileInputStream(file); Workbook workbook = StreamingReader.builder() for (Sheet sheet : workbook) { for (Row row : sheet) { for (Cell cell : row) { String cellValue = cell.getStringCellValue(); System.out.println(cellValue); } } } } catch (FileNotFoundException e) { e.printStackTrace(); } } }


上一篇:
下一篇:
切换中文