我用java读取excel,当循环行的时候,根据不同的列,取出不同的值,再进行不同的操作,
如:
for(Row row : sheet)
{
String s = row.getCell(0).getStringCellValue();
System.out.println(s+"classes");
String s = row.getCell(0).getStringCellValue();
System.out.println(s+"name");
},但是总是出现如下的错误,java.lang.IllegalStateException: Cannot get a text value from a numeric cell,有哪位高人指点一下,小女子不胜感激,因为我是新来的 ,所以没办法给分,抱歉啊
如:
for(Row row : sheet)
{
String s = row.getCell(0).getStringCellValue();
System.out.println(s+"classes");
String s = row.getCell(0).getStringCellValue();
System.out.println(s+"name");
},但是总是出现如下的错误,java.lang.IllegalStateException: Cannot get a text value from a numeric cell,有哪位高人指点一下,小女子不胜感激,因为我是新来的 ,所以没办法给分,抱歉啊
把numeric类型转为String
{
int s = row.getCell(0).getNumericCellValue();
System.out.println(s+"classes");
int s = row.getCell(0).getNumericCellValue();
System.out.println(s+"name");
}