设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

fastexcel v0.0.2 发布,快速简单操作excel小工具

2015-3-17 22:55| 发布者: joejoe0332| 查看: 493| 评论: 0|原作者: oschina|来自: oschina

摘要: FastExcel 能快速简单读取excel数据,将Apache POI进行了薄封装,基于注解,更加易于使用,此版本是第二个版本,本次更新修复了空单元格导出BUG问题项目地址:github:https://github.com/sd4324530/fastexcelosc:htt ...

FastExcel 能快速简单读取excel数据,将Apache POI进行了薄封装,基于注解,更加易于使用,此版本是第二个版本,本次更新修复了空单元格导出BUG问题

项目地址:

github: https://github.com/sd4324530/fastexcel

osc: http://git.oschina.net/pyinjava/fastexcel

使用样例

1
2
3
4
5
6
7
8
9
10
FastExcel fastExcel = new FastExcel("E:/data.xlsx");
        fastExcel.setSheetName("活动信息数据");
        List<MyTest> tests = fastExcel.parse(MyTest.class);
        if(null != tests && !tests.isEmpty()) {
            for(MyTest myTest : tests) {
                LOG.debug("记录:{}", myTest.toString());
            }
        else {
            LOG.debug("没有结果");
        }

映射类:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class MyTest {
  
    @MapperCell(cellName = "名称")
    private String name;
  
    @MapperCell(cellName = "联系电话")
    private String phone;
  
    @MapperCell(cellName = "地址")
    private String address;
  
    @MapperCell(cellName = "一级分类ID")
    private int type;
  
    @MapperCell(cellName = "经度")
    private double lat;
  
}

酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部