We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
描述问题:
官网示例代码展示了如何读取 Excel所有Sheet 的前多少行数据,但示例中默认只读取了第一个 Sheet,而未按预期读取所有 Sheet 页的前 100 行。
官网示例代码:
EasyExcel.read(fileName, DemoData.class, new PageReadListener<DemoData>(dataList -> { for (DemoData demoData : dataList) { log.info("读取到一条数据{}", JSON.toJSONString(demoData)); } })).numRows(100).sheet().doRead();
预期行为:
实际行为:
复现步骤:
11:38:27.521 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串101"} 11:38:27.523 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串2"} 11:38:27.523 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串3"} 11:38:27.523 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串4"} 11:38:27.523 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串5"} 11:38:27.524 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串6"} 11:38:27.524 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串7"} 11:38:27.524 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串8"} 11:38:27.524 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串9"} 11:38:27.524 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串10"} 11:38:27.525 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串11"} 11:38:27.525 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串12"} 11:38:27.525 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串13"} 11:38:27.525 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串14"} 11:38:27.525 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串15"} 11:38:27.526 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串16"} 11:38:27.526 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串17"} 11:38:27.526 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串18"} 11:38:27.526 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串19"} 11:38:27.526 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串20"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串21"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串22"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串23"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串24"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串25"} 11:38:27.527 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串26"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串27"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串28"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串29"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串30"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串31"} 11:38:27.528 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串32"} 11:38:27.529 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串33"} 11:38:27.529 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串34"} 11:38:27.529 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串35"} 11:38:27.529 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串36"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串37"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串38"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串39"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串40"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串41"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串42"} 11:38:27.530 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串43"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串44"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串45"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串46"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串47"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串48"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串49"} 11:38:27.531 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串50"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串51"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串52"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串53"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串54"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串55"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串56"} 11:38:27.532 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串57"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串58"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串59"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串60"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串61"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串62"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串63"} 11:38:27.533 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串64"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串65"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串66"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串67"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串68"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串69"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串70"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串71"} 11:38:27.534 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串72"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串73"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串74"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串75"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串76"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串77"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串78"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串79"} 11:38:27.535 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串80"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串81"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串82"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串83"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串84"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串85"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串86"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串87"} 11:38:27.536 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串88"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串89"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串90"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串91"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串92"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串93"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串94"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串95"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串96"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串97"} 11:38:27.537 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串98"} 11:38:27.538 [main] INFO com.sprixin.FastExcelTest -- 读取到一条数据{"date":"2024-12-22 09:58:42","doubleData":0.65,"string":"字符串99"}
The text was updated successfully, but these errors were encountered:
我去验证一下这个问题
Sorry, something went wrong.
@Lyx3ZzSs 你可以参考https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read#%E8%AF%BB%E5%A4%9A%E4%B8%AAsheet,读取多行
https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read#%E8%AF%BB%E5%A4%9A%E4%B8%AAsheet
psxjoy
No branches or pull requests
描述问题:
官网示例代码展示了如何读取 Excel所有Sheet 的前多少行数据,但示例中默认只读取了第一个 Sheet,而未按预期读取所有 Sheet 页的前 100 行。
官网示例代码:
预期行为:
实际行为:
复现步骤:
The text was updated successfully, but these errors were encountered: