Unable to recognize OLE stream 的解决方法

将xlsx用excel打开并另存为2003的xls,然后再运行即可解决问题

File file = new File("E:\\work.xls");
Workbook workbook = Workbook.getWorkbook(file);
//2:获取第一个工作表sheet
Sheet sheet = workbook.getSheet(0);
for (int i = 0; i < sheet.getRows(); i++) {
Stu bean = null;
String name="";
String num="";
for (int j = 0; j < sheet.getColumns(); j++) {
Cell cell = sheet.getCell(j, i);
bean = new Stu();
if (j == 1)
name = cell.getContents();
if (j == 4)
num = cell.getContents();
}
map.put(name,num);
}
//最后一步:关闭资源
workbook.close();

Java读取Excel报错Unable to recognize OLE stream的更多相关文章

  1. JAVA读取EXCEL文件异常Unable to recognize OLE stream

    异常: jxl.read.biff.BiffException: Unable to recognize OLE stream at jxl.read.biff.CompoundFile.<in ...

  2. java导出excel报错:getOutputStream() has already been called for this response

    对于java导出excel报错的问题,查了很多都说是在使用完输出流以后调用以下两行代码即可 out.clear(); out = pageContext.pushBody(); 但这也许是页面上输出时 ...

  3. jxl.read.biff.BiffException: Unable to recognize OLE stream异常

    java代码读取excel文件时报: jxl.read.biff.BiffException: Unable to recognize OLE stream    at jxl.read.biff.C ...

  4. java应用启动报错Unable to access jarfile xxxxx.jar

    当使用命令:javar -jar xxxx.jar 启动应用时,报错Unable to access jarfile xxxxx.jar,这种主要是 jar 的名称或者路径有问题:

  5. Java 读取excel 文件 Unable to recognize OLE stream 错误

    原因:不支出读取 excel 2007 文件(*.xlsx).只支持 excel 2003 (*.xls).

  6. (后台)java 读取excel 文件 Unable to recognize OLE stream 错误

    原因:不支出读取 excel 2007 文件(*.xlsx).只支持 excel 2003 (*.xls). 光修改文件后缀不行,需要文件另存(或者导出)为 .xls Excel 1997-2004 ...

  7. 使用NPOI读取Excel报错ICSharpCode.SharpZipLib.Zip.ZipException:Wrong Local header signature

    写了一个小程序利用NPOI来读取Excel,弹出这样的报错: ICSharpCode.SharpZipLib.Zip.ZipException:Wrong Local header signature ...

  8. 用pandas读取excel报错

    用pandas.read_execl()方法读取excel文件报错. 后来导入xlrd第三方库,就好了.

  9. (后台)jxl.read.biff.BiffException: Unable to recognize OLE stream

    在excel中打开,另存成xls就可以.

随机推荐

  1. 【C/C++】用C语言编写爬虫—爬虫程序优化要点

    写一个网络爬虫   用C语言来写一个网络爬虫,来获取一个网站上感兴趣的信息,抓取自己需要的一切. #include<cspider/spider.h>/* 自定义的解析函数,d为获取到的h ...

  2. spring boot:用dynamic-datasource-spring-boot-starter配置多数据源访问seata(seata 1.3.0 / spring boot 2.3.3)

    一,dynamic-datasource-spring-boot-starter的优势? 1,dynamic-datasource-spring-boot-starter 是一个基于springboo ...

  3. centos8安装php7.4

    一,下载php7.4 1,官方网站: https://www.php.net/ 2,下载 [root@yjweb source]# wget https://www.php.net/distribut ...

  4. selenium自动登陆

    import osfrom selenium import webdriverimport time,jsonclass Cookie(object): def __init__(self,drive ...

  5. request-html 使用

    from requests_html import HTMLSessionsession = HTMLSession()resp = session.get('http://www.spbeen.co ...

  6. docker-docker-compose 安装

    1.安装docker-compose(官网:https://github.com/docker/compose/releases) 安装: curl -L https://github.com/doc ...

  7. 洛谷 P6419 Kamp 题解

    明天就SX AFO了交篇题解%一下 这题大概是我第一道有独立思考切掉的紫题 之前的都是各种抄借鉴题解 为什么写这题的题解呢?另一个重要的原因是这样的↓ 翻了翻已有题解中的几篇,下面几种情况屡见不鲜 样 ...

  8. 用python和GDAL 读取GRIB数据

    from osgeo import gdal import numpy as np path = './data/201912/anl_surf125.2019120100' dataset = gd ...

  9. Linux文件系统和管理-2文件操作命令(上)

    文件操作命令 文件 文件也包括目录 目录是一种特殊的文件 目录 一个目录名分成两部分 所在目录 dirname 父目录的路径 文件名 basename 本身就是两个命令 [root@C8-1 misc ...

  10. Vue3: 如何以 Vite 创建,以 Vue Router, Vuex, Ant Design 开始应用

    本文代码: https://github.com/ikuokuo/start-vue3 在线演示: https://ikuokuo.github.io/start-vue3/ Vite 创建 Vue ...