没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
Workbook workbook = null;
File importFile = null;
InputStream is = null;
List<LinkedList<String>> totalDataList = new LinkedList<>();
if (file.equals("") || file.getSize() <= 0) {
file = null;
} else {
is = file.getInputStream();
importFile = new File(file.getOriginalFilename());
inputStreamToFile
(is, importFile);
is.close();
}
List<?> pictures = new LinkedList<>();
try {
is = new FileInputStream(importFile);
if (importFile.getAbsolutePath().endsWith(".xls")) {
workbook = new HSSFWorkbook(is);
} else if (importFile.getAbsolutePath().endsWith(".xlsx")) {
workbook = new XSSFWorkbook(is);
}
int sheetCount = workbook.getNumberOfSheets();
if (sheetCount > 0) {
// 文本内容
for (int i = 0; i < sheetCount; i++) {
Sheet sheet = workbook.getSheetAt(0);
LinkedList<String> midList = new LinkedList<>();
for (int rownum = sheet.getFirstRowNum() + 1; rownum <= sheet.getLastRowNum(); rownum++) {
Row row = sheet.getRow(rownum);
if (row == null || row.getFirstCellNum() < 0) {
break;
}
for (int columnnum = row.getFirstCellNum(); columnnum <= row
.getLastCellNum(); columnnum++) {
String cellValue = getCellValue(row.getCell(columnnum));
if (cellValue.trim().equals("无")) {
cellValue = null;
}
英次
- 粉丝: 20
- 资源: 306
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0