比 JAVA 中的 vlookup 更好的选择 [英] Better options than vlookup in JAVA

查看:27
本文介绍了比 JAVA 中的 vlookup 更好的选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发涉及比较两个 Excel 表格的程序.我有点成功地使用 excel vlookup 简单地应用了一个列.

I'm working on program which involves comparing two excel sheets. I kind of succeeded using the excel vlookup simply applying a column.

我认为当床单变大时它有点慢,所以我想知道是否有其他方法可以加快这个过程.我的意思是我可以研究的任何其他 JAVA 实现真的对我有帮助吗?

I think it is kind of slow when the sheets get bigger so i was wondering if there is any other way i could speed up this process. I mean any other JAVA implementation i could look into which would really help me?

推荐答案

我在 java 中处理 Office 2007+ excel 文件的方式是

The way I do this sort of thing in java regarding office 2007+ excel files is

  • 在 excel 文件中打开一个 ZipInputStream
  • 使用 XML 解析器读取 SheetN.XML 条目.N 是您尝试阅读的工作表的编号
  • 使用 xml 解析器读入共享字符串文件并构建查找表

从那里你可以实现你需要的任何算法.查看 [此电子表格xml 演练] (http://openxmldeveloper.org/wiki/w/wiki/introduction-to-spreadsheetml.aspx) 以获取有关 excel 文件结构的信息.

From there you can implement whatever algorithm you need to. Check out [this spreadsheetxml walkthrough] (http://openxmldeveloper.org/wiki/w/wiki/introduction-to-spreadsheetml.aspx) for information on excel's file structure.

这篇关于比 JAVA 中的 vlookup 更好的选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆