问题
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