Better options than vlookup in JAVA

北城余情 提交于 2019-12-11 06:26:02

问题


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

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?


回答1:


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

  • Open a ZipInputStream on the excel file
  • Read the SheetN.XML entry(ies) using an XML parser. N is the number of the sheet (s) you are trying to read in
  • Read in the shared strings file using an xml parser and build a lookup table

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.



来源:https://stackoverflow.com/questions/20838937/better-options-than-vlookup-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!