-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xlsx读取时和展示看到的一样,部分数据有随机前缀 #3823
Labels
help wanted
Extra attention is needed
Comments
It is not a bug, change to the |
原始文件本身格式有问题,让客户,或者你自己提供一个正常的表格文件即可。 |
原始文件本身格式有问题,可以详说下什么原因/什么插件导致的吗? |
通过历史数据查询,4,5个用户都有这个问题,使用的WPS12.1.0.16929 让客户更换WPS,不知是否可以解决此类问题吗? |
POI SXSSF方式导入 发现 E2 列 输出两次值 E2-11
E2-EJ7336793
E3-759363084
E3-E55155204 public static void excelReadSXSSFTest(String filename) throws Exception {
//1.创建工作簿,使用excel能操作的这边都看看操作
OPCPackage opcPackage = OPCPackage.open(filename);
XSSFReader xssfReader = new XSSFReader(opcPackage);
StylesTable stylesTable = xssfReader.getStylesTable();
ReadOnlySharedStringsTable sharedStringsTable = new ReadOnlySharedStringsTable(opcPackage);
// 创建XMLReader,设置ContentHandler
XMLReader xmlReader = SAXHelper.newXMLReader();
xmlReader.setContentHandler(new XSSFSheetXMLHandler(stylesTable, sharedStringsTable, new XSSFSheetXMLHandler.SheetContentsHandler() {
@Override
public void startRow(int rowNum) {
}
@Override
public void endRow(int rowNum) {
}
@Override
public void cell(String cellReference, String formattedValue, XSSFComment comment) {
if (ListUtil.of("E2", "E3").contains(cellReference)) {
Console.log("{}-{}", cellReference, formattedValue);
}
}
}, false));
// 解析每个Sheet数据
Iterator<InputStream> sheetsData = xssfReader.getSheetsData();
while (sheetsData.hasNext()) {
try (InputStream inputStream = sheetsData.next();) {
xmlReader.parse(new InputSource(inputStream));
}
}
} |
@psxjoy 好的,我修改下导入模板E2列格式,后续再观察下~ |
psxjoy
added
help wanted
Extra attention is needed
and removed
bug
Something isn't working
labels
Jun 25, 2024
This was referenced Jul 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
触发场景描述
读取xlsx内容时,护照号码部分数据与文件显示值不一致
1、读取用户提供的excel时,护照号码,部分数据与文件显示值不一致
2、拷贝用户提供的excel文件,不做任何修改直接保存,读取内容与显示值一致
工具版本信息
JDK:1.8.0_361
SpringBoot:2.7.18
easyexcel版本: 3.2.1 / 3.3.3
客户excel 版本: wps表格版本号【12.1.0.16929】
本地excel 版本:office 2021,wps 2024 16929
Hutool:5.8.25
触发Bug的代码
excel 文件
客户提供文件 :
6-3 E83307--6.xlsx
本地拷贝保存后文件:
6-3 E83307--6 - 副本.xlsx
The text was updated successfully, but these errors were encountered: