1.在解析Excel表格中由纯数字组成的字符时会报错
String telephone = row.getCell(1).getStringCellValue();
java.lang.IllegalStateException: Cannot get a text value from a numeric cell
2.然后为了解决这个问题:用getNumericCellValue()方法得到数字在转换为字符串
String telephone = row.getCell(1).getNumericCellValue()+"";
4.解决这个问题我们可以使用DecimalFormat对double类型数据进行格式话,然后使用format方法获得的String:
DecimalFormat df = new DecimalFormat("0");
String telephone = df.format(row.getCell(1).getNumericCellValue());