寻找读 excel 写入 DB 的方案

【问题】

What is the best way to read excel spreadsheet?

I need to programmtically read excel spreadsheet and then insert the data into a database.  Although I am more inclined towards Perl or Java, I want to know the best and fastest possible way.  Language and technology no bar.  Also, if it's open source, then better.

别人的回答:

Have you looked at jq? It's a utility, but it's open source and has its own parsing syntax akin to XPath. You could probably also port it.

Similarly, almost every language out there has a very current and powerful library for parsing JSON. Python has simplejson, Ruby has, uh, the "json" gem, Java has Jackson JSON Processor - Home, the list goes on.

【回答】

Perl访问excel需要先执行cpan Spreadsheet::ParseExcel命令安装相关的类包,然后调用其接口访问。Java可以利用POI访问excel,但是在数据类型处理和数据计算(条件过滤、分组、连接等)方面都比较复杂。推荐使用集算器,读取excel只需要一行代码:=file("D:\\data.xls").xlsimport(),而且可以在IDE中浏览导入的数据。集算器支持jdbc,可以方便的将excel数据写入数据库,参考【SPL 实现 txt 和 Excel 数据入库】。虽然集算器不是开源的,但是有免费版本。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值