请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

取Excel单元格文件值时报错Error: org/apache/commons/compress/archivers/zip/ZipFile

import java.io.FileInputStream;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class ExcelRead {

public static void main(String[] args) {
	XSSFWorkbook excelWook;
	XSSFSheet excelWheet;
	XSSFCell cell;
	String path = "E:\\White_testNG\\ExcelRead.xlsx";
	String sheetName = "导入数据";
	try {
		FileInputStream exxelFile = new FileInputStream(path);
		excelWook = new XSSFWorkbook(exxelFile);
		excelWheet = excelWook.getSheet(sheetName);
		cell = excelWheet.getRow(3).getCell(2);
		String cellData = cell.getStringCellValue();
		System.out.println("cell data: " + cellData);
	} catch (Exception e) {
		e.printStackTrace();
	}
}

}

正在回答 回答被采纳积分+3

2回答

夏天 2018-09-26 22:19:25

好的,谢谢分享啊

0 回复 有任何疑惑可以回复我~
提问者 慕先生8120188 2018-09-26 15:46:31

已解决:jar导入commons-compress-1.18
下载地址:https://commons.apache.org/proper/commons-compress/download_compress.cgi?Preferred=http%3A%2F%2Fmirrors.tuna.tsinghua.edu.cn%2Fapache%2F

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号