1金币
本帖最后由 Clark.Pan 于 2023-4-4 10:37 编辑
GcExcel获取单元格内容:java.lang.OutOfMemoryError: Java heap space
代码如下,ssjson如附件
- public static void main(String[] args) throws Exception {
- Workbook workbook = new Workbook();
- workbook.open("gongyi.ssjson");
- IWorksheet worksheet = workbook.getWorksheets().get(0);
- int rowCount = worksheet.getRowCount();
- int columnCount = worksheet.getColumnCount();
- System.out.println(rowCount);
- for (int i = 0; i < rowCount; i++) {
- for (int j = 0; j < columnCount; j++) {
- System.out.println("第" + i + "行,第" + j + "列的值为:" + worksheet.getRange(i, j).getText());
- }
- }
- }
复制代码
|
|