使⽤poi读取excel⽂件Cannotgetatextvaluefromanumericcell 我这样转换得到⼀个excel⽂本域的值
Cell cell = Cell(c);
最好的朋友英文cell.tCellType(Cell.CELL_TYPE_STRING);
有虞氏>背影的作者String parkName = StringCellValue();
某些时候,读取 excel ⽂件会出现如下错误
三国三十六计
java.lang.IllegalStateException: Cannot get a text value from a numeric cell
at org.apache.poi.hssf.peMismatch(HSSFCell.java:640)
在这⾥找到了解决⽅案
对我的原代码进⾏更改
DataFormatter formatter = new DataFormatter(); //creating formatter using the default locale
香港大营救Cell cell = Cell(c);
最美的什么作文
秋夕节String parkName = formatter.formatCellValue(cell); //Returns the formatted value of a cell as a String regardless of the cell type.
despite