读取excel时报错:Exception in thread “main” java.lang.IllegalStateException: Cannot get a text value from a numeric cell
问题代码在这一行row.getCell(j).getStringCellValue();
原因时类型问题,需要先把格式转成为string,所以在这行代码上面添加
row.getCell(j).setCellType(Cell.CELL_TYPE_STRING); fields[j] = row.getCell(j).getStringCellValue();
则可以解决
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)