我正在尝试使用来自 apache 站点http://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api的代码读取包含单词而不是数字数据的 excel 文件
我收到以下错误:
Processing new sheet:
A1 - Have a nice day
Exception in thread "main" java.lang.NumberFormatException: For input string: "Have a nice day"
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111)
at ExcelExtract.processAllSheets(ExcelExtract.java:48)
at ExcelExtract.main(ExcelExtract.java:119)
Caused by: java.lang.NumberFormatException: For input string: "Have a nice day"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at ExcelExtract$SheetHandler.endElement(ExcelExtract.java:99)
at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1204)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
... 2 more
还有什么方法可以在不使用 xerces.jar 的情况下仅使用 poi xssf 事件模型读取 xlsx 文件?请告知是否有任何其他示例代码可用。