gpt4 book ai didi

java - jxl.read.biff.BiffException : Unable to recognize OLE stream

转载 作者:太空宇宙 更新时间:2023-11-04 13:51:27 24 4
gpt4 key购买 nike

我想在 Android 应用程序中打开 Excel 文件。我已将该文件复制到 Assets 文件夹(asset/Referance/myfile_db.xlsx)。创建工作簿时,我收到错误jxl.read.biff.BiffException:无法识别 OLE 流。这是我的代码,

       try{
InputStream is = context.getAssets().open("Referance/myfile_db.xlsx");
if(is!=null){
Workbook w = Workbook.getWorkbook(is); //Here am getting the Error
Sheet sheet = w.getSheet(0);
for (int j = 0; j < sheet.getRows(); j++) {
Cell cell = sheet.getCell(0, j);
System.out.println("Col "+j+": "+cell.getContents().toString());
if(cell.getContents().trim().equalsIgnoreCase("Charger Rating Volts")){
for (int i = 0; i < sheet.getColumns(); i++) {
Cell cel = sheet.getCell(i, j);
System.out.println("Col "+j+": "+cel.getContents().toString());
}
}
}
}
}catch (Exception e) {
System.out.println("Error On Reading Excel : "+e.getMessage());
}

最佳答案

此库不支持导入 .xlsx 文件格式。

关于java - jxl.read.biff.BiffException : Unable to recognize OLE stream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30236459/

24 4 0