我正在编写一些代码来读取一个excel文件。此时我正在尝试确定单元格的类型。
val wb:HSSFWorkbook= new HSSFWorkbook(fileInput)
val sheet:HSSFSheet = wb.getSheetAt(0);
val rows = sheet.rowIterator()
while(rows.hasNext()){
var row = rows.next()
val cells = row.cellIterator()
while(cells.hasNext()){
val cell = cells.next()
println(cell.getCellType()== org.apache.poi.hssf.usermodel.HSSFCell.CELL_TYPE_NUMERIC)}}
它说
value CELL_TYPE_NUMERIC is not a member of object org.apache.poi.hssf.usermodel.HSSFCell
我不明白为什么我无法访问该字段。你能帮忙吗?
问候