try {
InputStream is = new FileInputStream(Thread.currentThread()
.getContextClassLoader().getResource("123.xls").getPath());
Workbook rwb = Workbook.getWorkbook(is);
Sheet rs = rwb.getSheet(0);// 参数设置读文件的第几页
int rsRows = rs.getRows(); // 获取Sheet表中所包含的总行数
for (int i = 0; i < rsRows; i++) {
Cell[] row = rs.getRow(i);
String bid=row[0].getContents().trim();
}
} catch (Exception e) {
e.printStackTrace();
}
java读取xls文件
最新推荐文章于 2023-07-30 22:17:53 发布