- 浏览: 725968 次
- 性别:
- 来自: 宁波
文章分类
- 全部博客 (125)
- 软件开发 (17)
- java (32)
- js (2)
- jsp (1)
- struts2 (1)
- jquery (4)
- oracle (12)
- 程序员 (2)
- 三星i9300 联通版 root (1)
- easyui (2)
- DOM4J (2)
- 哲学 (1)
- ftp (1)
- oracle每日一学 (2)
- spring (4)
- jquery每日一学 (5)
- shiro (4)
- ITextRenderer (1)
- shiro标签 (1)
- mysql (1)
- mysql每日一学 (4)
- 分词 (1)
- vtiger crm (1)
- IkAnalyzer (1)
- jsoup (1)
- 多线程 (1)
- quartz (1)
- ubuntu (2)
- gradle学习笔记 (1)
- node.js (1)
- ajax (1)
- mybatis (1)
- cas (2)
- cxf (1)
- jqgrid (1)
- 开发工具破解 (1)
最新评论
-
氵每市蜃木娄:
使用过后,移动滚动条,非冻结的列,表头不见了。
easyui datagrid 右冻结 -
18335864773:
推荐用pageoffice组件打开文档,pageoffice ...
java word导出 -
xiaoliuf4565:
用过之后中文可以换行,但是现在编程了英文和数字不换行了脑壳痛
freemarker+ITextRenderer 生成html转pdf -
A741841403:
Error:(275, 29) java: 无法访问com.l ...
freemarker+ITextRenderer 生成html转pdf -
A741841403:
楼主你好,我想问下,如何在maven中使用你的jar包呢
freemarker+ITextRenderer 生成html转pdf
网上看了很多资料 比价乱 而且 质量参差不齐 ,自己 通过实践和看资料学习
完整的 总结了这两个java里常用的工具类
整合成两个通用的方法
为了取值更加方便我用了 json来 组装数据
其实 最新的poi3.9已经可以用一个方法来 读取excel2003和2007了
但是我为了业务逻辑更加清楚才分开来 ,如果 你觉得还可以重构的更好 可以 发出你的改良后的代码哦
调用的时候 根据文件后缀名分别调用不同的方法就行
测试
这样可以获取对应表头的值
完整的 总结了这两个java里常用的工具类
整合成两个通用的方法
为了取值更加方便我用了 json来 组装数据
其实 最新的poi3.9已经可以用一个方法来 读取excel2003和2007了
但是我为了业务逻辑更加清楚才分开来 ,如果 你觉得还可以重构的更好 可以 发出你的改良后的代码哦
import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Date; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import net.sf.json.JSONObject; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * Excel 操作工具类 其中涉及几个文件流操作和转换 * @author zqb * * 2013-8-2 */ public class ExcelUtil { private static POIFSFileSystem fs; private static HSSFWorkbook wb; private static HSSFSheet sheet; private static HSSFRow row; private static FileInputStream input; private static String[] excleTitle; public static boolean isNum(String str) { return str.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$"); } /** * 根据文件路径读取Excel数据内容 返回map * @param excelPath * @return */ public static Map<Integer, JSONObject> readExcelContent(String excelPath) { Map<Integer, JSONObject> contentJson = new LinkedHashMap<Integer, JSONObject>(); String excelStr = "";// excel 内容 try { input = new FileInputStream(new File(excelPath)); fs = new POIFSFileSystem(input); wb = new HSSFWorkbook(fs); sheet = wb.getSheetAt(0); int rowNum = sheet.getLastRowNum(); // 得到总行数 row = sheet.getRow(0);// 得到标题的内容对象。 int colNum = row.getPhysicalNumberOfCells();// 得到每行的列数。 excleTitle = new String[colNum]; for (int i = 0; i < colNum; i++) { excleTitle[i] = getStringCellValue(row.getCell((short) i)); } // 正文内容应该从第二行开始,第一行为表头的标题 for (int i = 1; i <= rowNum; i++) { row = sheet.getRow(i); int j = 0; while (j < colNum) { String v = ""; if (j + 1 == colNum) { String vs = getStringCellValue(row.getCell((short) j)) .trim(); if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } else { String vs = getStringCellValue(row.getCell((short) j)) .trim() + "&"; if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { // 处理用poi读取excel整数后面加.0的格式化 v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } j++; } String excelstrArray[] = excelStr.split("&", -1); // 每行数据 Map<String, String> params = new LinkedHashMap<String, String>(); for (int k = 0; k < excelstrArray.length; k++) { params.put(excleTitle[k], excelstrArray[k]); } JSONObject jsonObject = JSONObject.fromObject(params); contentJson.put(i, jsonObject); // content.put(i, excelStr); excelStr = ""; } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { e.printStackTrace(); } } return contentJson; } /** * 根据文件流读取Excel数据内容 返回map 2003 * @param input * @return */ public static Map<Integer, JSONObject> readExcelContent( InputStream input) {// 读取Excel数据内容 Map<Integer, JSONObject> contentJson = new LinkedHashMap<Integer, JSONObject>(); String excelStr = "";// excel 内容 try { fs = new POIFSFileSystem(input); wb = new HSSFWorkbook(fs); sheet = wb.getSheetAt(0); int rowNum = sheet.getLastRowNum(); // 得到总行数 row = sheet.getRow(0);// 得到标题的内容对象。 int colNum = row.getPhysicalNumberOfCells();// 得到每行的列数。 excleTitle = new String[colNum]; for (int i = 0; i < colNum; i++) { excleTitle[i] = getStringCellValue(row.getCell((short) i)); } // 正文内容应该从第二行开始,第一行为表头的标题 for (int i = 1; i <= rowNum; i++) { row = sheet.getRow(i); int j = 0; while (j < colNum) { String v = ""; if (j + 1 == colNum) { String vs = getStringCellValue(row.getCell((short) j)) .trim(); if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } else { String vs = getStringCellValue(row.getCell((short) j)) .trim() + "&"; if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { // 处理用poi读取excel整数后面加.0的格式化 v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } j++; } String excelstrArray[] = excelStr.split("&", -1); // 每行数据 Map<String, String> params = new LinkedHashMap<String, String>(); for (int k = 0; k < excelstrArray.length; k++) { params.put(excleTitle[k], excelstrArray[k]); } JSONObject jsonObject = JSONObject.fromObject(params); contentJson.put(i, jsonObject); // content.put(i, excelStr); excelStr = ""; } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { e.printStackTrace(); } } return contentJson; } /** * 读取Office 2007 excel * */ public static Map<Integer, JSONObject> read2007Excels(InputStream input) throws IOException { Map<Integer, JSONObject> contentJson = new LinkedHashMap<Integer, JSONObject>(); // 构造 XSSFWorkbook 对象,strPath 传入文件路径 XSSFWorkbook xwb = new XSSFWorkbook(input); // 读取第一章表格内容 XSSFSheet sheet = xwb.getSheetAt(0); Object value = null; XSSFRow row = null; XSSFCell cell = null; XSSFRow headerrow = sheet.getRow(0); // 表头 得到标题的内容对象 int colNum = headerrow.getPhysicalNumberOfCells();// 得到每行的列数。 excleTitle = new String[colNum]; for (int i = 0; i < colNum; i++) { excleTitle[i] = getStringCellValue(headerrow.getCell((short) i)); } // System.out.println(sheet.getPhysicalNumberOfRows()); // 循环内容项 不循环标题 所以+1 for (int i = sheet.getFirstRowNum() + 1; i <= sheet .getPhysicalNumberOfRows(); i++) { row = sheet.getRow(i); if (row == null) { continue; } List<String> linked = new LinkedList<String>(); for (int j = row.getFirstCellNum(); j < row.getLastCellNum(); j++) { cell = row.getCell(j); if (null != cell) { value = getStringCellValue(cell); } linked.add(StringUtil.stringIsNull(value)); } Map<String, String> params = new LinkedHashMap<String, String>(); for (int j = 0; j < linked.size(); j++) { params.put(excleTitle[j], linked.get(j)); } JSONObject jsonObject = JSONObject.fromObject(params); contentJson.put(i, jsonObject); } return contentJson; } /** * 根据(字节串(或叫字节数组)变成输入流的形式)读取Excel数据内容 返回map * @param input * @return */ public static Map<Integer, JSONObject> readExcelContent( ByteArrayInputStream input) {// 读取Excel数据内容 // Map<Integer, String> content = new HashMap<Integer, String>(); Map<Integer, JSONObject> contentJson = new LinkedHashMap<Integer, JSONObject>(); String excelStr = "";// excel 内容 try { // ByteArrayInputStream is = new ByteArrayInputStream( new byte[1000]); fs = new POIFSFileSystem(input); wb = new HSSFWorkbook(fs); sheet = wb.getSheetAt(0); int rowNum = sheet.getLastRowNum(); // 得到总行数 row = sheet.getRow(0);// 得到标题的内容对象。 int colNum = row.getPhysicalNumberOfCells();// 得到每行的列数。 excleTitle = new String[colNum]; for (int i = 0; i < colNum; i++) { excleTitle[i] = getStringCellValue(row.getCell((short) i)); } // 正文内容应该从第二行开始,第一行为表头的标题 for (int i = 1; i <= rowNum; i++) { row = sheet.getRow(i); int j = 0; while (j < colNum) { String v = ""; if (j + 1 == colNum) { String vs = getStringCellValue(row.getCell((short) j)) .trim(); if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } else { String vs = getStringCellValue(row.getCell((short) j)) .trim() + "&"; if (vs.indexOf(".") > -1) { if (isNum(vs)) { // 是否是数字 if (vs.endsWith("0")) { // 处理用poi读取excel整数后面加.0的格式化 v = vs.substring(0, vs.indexOf(".")); } } else { v = vs.trim(); } } else { v = vs.trim(); } excelStr += v; } j++; } String excelstrArray[] = excelStr.split("&", -1); // 每行数据 Map<String, String> params = new LinkedHashMap<String, String>(); for (int k = 0; k < excelstrArray.length; k++) { params.put(excleTitle[k], excelstrArray[k]); } JSONObject jsonObject = JSONObject.fromObject(params); contentJson.put(i, jsonObject); // content.put(i, excelStr); excelStr = ""; } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { e.printStackTrace(); } } return contentJson; } /** * 获取单元格数据内容为字符串类型的数据 * @param cell * @return */ private static String getStringCellValue(HSSFCell cell) { String strCell = ""; switch (cell.getCellType()) { case HSSFCell.CELL_TYPE_STRING: strCell = cell.getStringCellValue(); break; case HSSFCell.CELL_TYPE_NUMERIC: strCell = String.valueOf(cell.getNumericCellValue()); break; case HSSFCell.CELL_TYPE_BOOLEAN: strCell = String.valueOf(cell.getBooleanCellValue()); break; case HSSFCell.CELL_TYPE_BLANK: strCell = ""; break; default: strCell = ""; break; } if (strCell.equals("") || strCell == null) { return ""; } if (cell == null) { return ""; } return strCell; } /** * 获取单元格数据内容为日期类型的数据 * @param cell * @return */ private static String getDateCellValue(HSSFCell cell) { String result = ""; try { int cellType = cell.getCellType(); if (cellType == HSSFCell.CELL_TYPE_NUMERIC) { Date date = cell.getDateCellValue(); result = (date.getYear() + 1900) + "-" + (date.getMonth() + 1) + "-" + date.getDate(); } else if (cellType == HSSFCell.CELL_TYPE_STRING) { String date = getStringCellValue(cell); result = date.replaceAll("[年月]", "-").replace("日", "").trim(); } else if (cellType == HSSFCell.CELL_TYPE_BLANK) { result = ""; } } catch (Exception e) { System.out.println("日期格式不正确!"); e.printStackTrace(); } return result; } /** * 根据byte数组,生成文件 */ public static void getFile(byte[] bfile, String filePath, String fileName) { BufferedOutputStream bos = null; FileOutputStream fos = null; File file = null; try { File dir = new File(filePath); if (!dir.exists() && dir.isDirectory()) {// 判断文件目录是否存在 dir.mkdirs(); } file = new File(filePath + "\\" + fileName); fos = new FileOutputStream(file); bos = new BufferedOutputStream(fos); bos.write(bfile); } catch (Exception e) { e.printStackTrace(); } finally { if (bos != null) { try { bos.close(); } catch (IOException e1) { e1.printStackTrace(); } } if (fos != null) { try { fos.close(); } catch (IOException e1) { e1.printStackTrace(); } } } } // 从byte[]转file public static File getFileFromBytes(byte[] b, String outputFile) { BufferedOutputStream stream = null; File file = null; try { file = new File(outputFile); if (!file.exists() && file.isDirectory()) {// 判断文件目录是否存在 file.mkdirs(); //mkdirs() 可以在不存在的目录中创建文件夹。诸如:a\\b,既可以创建多级目录。 } FileOutputStream fstream = new FileOutputStream(file); stream = new BufferedOutputStream(fstream); stream.write(b); } catch (Exception e) { e.printStackTrace(); } finally { if (stream != null) { try { stream.close(); } catch (IOException e1) { e1.printStackTrace(); } } } return file; } /** * 读取Office 2007 excel * */ private static Map<Integer, JSONObject> read2007Excels(File file) throws IOException { Map<Integer, JSONObject> contentJson = new LinkedHashMap<Integer, JSONObject>(); // 构造 XSSFWorkbook 对象,strPath 传入文件路径 XSSFWorkbook xwb = new XSSFWorkbook(new FileInputStream(file)); // 读取第一章表格内容 XSSFSheet sheet = xwb.getSheetAt(0); Object value = null; XSSFRow row = null; XSSFCell cell = null; XSSFRow headerrow = sheet.getRow(0); // 表头 得到标题的内容对象 int colNum = headerrow.getPhysicalNumberOfCells();// 得到每行的列数。 excleTitle = new String[colNum]; for (int i = 0; i < colNum; i++) { excleTitle[i] = getStringCellValue(headerrow.getCell((short) i)); } // System.out.println(sheet.getPhysicalNumberOfRows()); // 循环内容项 不循环标题 所以+1 for (int i = sheet.getFirstRowNum() + 1; i <= sheet .getPhysicalNumberOfRows(); i++) { row = sheet.getRow(i); if (row == null) { continue; } List<String> linked = new LinkedList<String>(); for (int j = row.getFirstCellNum(); j < row.getLastCellNum(); j++) { cell = row.getCell(j); if (null != cell) { value = getStringCellValue(cell); } linked.add(StringUtil.stringIsNull(value)); } Map<String, String> params = new LinkedHashMap<String, String>(); for (int j = 0; j < linked.size(); j++) { params.put(excleTitle[j], linked.get(j)); } JSONObject jsonObject = JSONObject.fromObject(params); contentJson.put(i, jsonObject); } return contentJson; } /** * 获取单元格数据内容为字符串类型的数据 * * @param cell * @return */ private static String getStringCellValue(XSSFCell cell) { String strCell = ""; switch (cell.getCellType()) { case HSSFCell.CELL_TYPE_STRING: strCell = cell.getStringCellValue(); break; case HSSFCell.CELL_TYPE_NUMERIC: strCell = String.valueOf(cell.getNumericCellValue()); break; case HSSFCell.CELL_TYPE_BOOLEAN: strCell = String.valueOf(cell.getBooleanCellValue()); break; case HSSFCell.CELL_TYPE_BLANK: strCell = ""; break; default: strCell = ""; break; } if (strCell.equals("") || strCell == null) { return ""; } if (cell == null) { return ""; } return strCell; } /** * 获得指定文件的byte数组 */ public static byte[] getBytes(String filePath) { byte[] buffer = null; try { File file = new File(filePath); FileInputStream fis = new FileInputStream(file); ByteArrayOutputStream bos = new ByteArrayOutputStream(1000); byte[] b = new byte[1000]; int n; while ((n = fis.read(b)) != -1) { bos.write(b, 0, n); } fis.close(); bos.close(); buffer = bos.toByteArray(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return buffer; }
调用的时候 根据文件后缀名分别调用不同的方法就行
测试
Map<Integer, JSONObject> content = new LinkedHashMap<Integer, JSONObject>(); if (version.equals("2003")) { content = ExcelUtil.readExcelContent(fileinput); } else if (version.equals("2007")) { content = ExcelUtil.read2007Excels(fileinput); } for (Map.Entry<Integer, JSONObject> entry : content.entrySet()) { System.out.println(entry.getValue().get("excel表头的名称"))); //这个循环里可以把这些值 组装到一个 po里 //这样取值更加方便 //比如 Po p=new Po(); po.setEntityName(entry.getValue().get("excel表头的名称"))); //....具体怎么扩展 更加适合你的项目 当然要你们自己思考了 呵呵... }
这样可以获取对应表头的值
- 所需jar.rar (10 MB)
- 下载次数: 77
发表评论
-
java word导出
2016-06-30 08:49 2538需要导出的word文档是事先准备好的一个模板,文档数据所在的位 ... -
spring 4mvc下载文件的实现
2016-06-14 13:52 2476网上找到的版本较老 是spring3的 org.spring ... -
cas不同登录页面手动设置不同国际化提示
2016-05-05 09:48 1224<% org.springframework.web. ... -
实用技术解决方案博客地址记录
2016-04-14 10:35 537Jquery 将表单序列化为Json对象:http://www ... -
如果实现类似微信附近的人功能
2016-01-13 10:09 2392如果实现类似微信附近的人功能: 第一种可以使用redis-ge ... -
cxf+wss4j+mysql webservice 加密服务开发
2015-11-04 10:02 2920我采用的是cxf 加密端用的 WSS4J 服务端查询数据库 ... -
多项目集中权限管理系统 采用cas +shiro+spring mvc+mbatis+bootstrap单点登录
2015-10-13 17:37 10122流程架构图: 这里权限系统也可以理解为cas client ... -
OAuthProblemException{error='unsupported_response_type', description='Invalid re
2015-09-21 18:05 4423OAuthProblemException{error='un ... -
导出数据到excel
2014-12-08 10:10 1355/** * * @param datas 数据行 ... -
java.lang.NoSuchMethodError: org.apache.axiom.soap.SOAPEnvelope.hasFault()Z错误的解决
2014-12-05 14:21 1572axis2 运行报这个错误的原因是 要么缺少 包 ,axiom ... -
spring mvc+shiro的通用权限管理系统
2014-10-23 13:50 26774同志们 我的 spring mvc+shiro的通用权限管理系 ... -
多线程断点下载文件
2014-09-23 15:46 1189所谓多线程断点下载 :就是当某个文件下了一部分后突然断电了,或 ... -
多线程下载文件
2014-09-22 17:27 2125package mutiDownload; import ... -
java按照每周分组 改进版
2014-07-07 16:07 4243之前是按照 先把数据按月分组 然后再按周分组 这样有个问题就是 ... -
java 按照每周分组
2014-06-09 09:07 6949本例的工作应用是导入excel excel的列里有一个发布日 ... -
java计算链表、数组列表或数组中最大元素
2014-03-09 23:50 2607package com; import java.uti ... -
java 获取数组的最大值和最小值
2014-03-02 22:08 6858package com; public class St ... -
宁波java开发技术群
2014-02-17 09:54 1宁波java开发群 240974225 在宁波做java开发的 ... -
spring mvc +jdbctemplate 返回多表查询List<Bean>
2013-12-27 13:19 17713发现 hibernate做多表查询 是忒麻烦了 Spring ... -
读《大型网站技术架构:核心原理与案例分析》 后感
2013-11-26 10:36 5613大型网站软件系统有比 ...
相关推荐
JAVA解析Excel工具EasyExcel Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存&#xff0c;poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题&#xff0c;但...
这是用java解析Excel的完整实例 读取 、封装
用java将数据写入excel,从excel中读取数据的方法。全套资源,包括所需jar包(poi)。
Excel POI读取封装(文件+示范代码) package org.excel.service; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java....
easyexcel重写了poi对07版Excel的解析,一个3M的excel用POI sax解析依然需要100M左右内存,改用easyexcel可以降低到几M,并且再大的excel也不会出现内存溢出;03版依赖POI的sax模式,在上层做了模型转换的封装,让...
9、excel文件解析功能:poi实现。 10、minio分布式存储:API封装并提供统一的请求接口。包括minio部署说明,以及minio 使用源代码 注意:需要安装minio服务端,参见readme文档 11、跨域问题解决。 12、线程池应用。
easyexcel重写了poi对07版Excel的解析,能够原本一个3M的excel用POI sax依然需要100M左右内存降低到KB级别,并且再大的excel不会出现内存溢出,03版依赖POI的sax模式。在上层做了模型转换的封装,让使用者更加简单...
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及...
JAVA解析Excel工具;Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如...
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及...
把公司用的封装了一下,用于解析excel文件到实体,使用注解,数据大的使用sax防止溢出 https://github.com/hellojamie/ebatis
EasyExcel 因为公司不方便用QQ,所以建议加钉钉群JAVA解析Excel工具EasyExcel 但他们都存在一个严重的问题就是非常的耗电量,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是Java解析,生成...
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及...
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及...
ExcelUtil,一个简单封装的excel解析和生成类,基于java poi组件实现excel通用导入导出
JAVA解析Excel工具easyexcel Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些...
easyexcel重写了poi对07版Excel的解析,能够原本一个3M的excel用POI sax依然需要100M左右内存降低到KB级别,并且再大的excel不会出现内存溢出,03版依赖POI的sax模式。在上层做了模型转换的封装,让使用者更加简单...
EasyExcel重写了POI对07Excel的解析,解决一部分了内存消耗特大的问题03版本任依赖POI的SAX模式 EasyExcel特点 1.数据模型层面进行了封装,使用简单 2.重写了07版本的Excel解析代码,减低内存消耗,可以有效避免OOM ...