METS BLOG

METS BLOG

Java Read Excel xlsx file – Part 2

In the first part, we got hold of the streams of sheets and strings, now to get the values of cells we will iterate through the xml elements like we normally do. There’s only one thing to be aware of, integers are saved in the sheet file but strings are accessed by indexes from the sharedstring file.

Heres how an excel cell looks in xml :

c – is the element name
r – is the attribute with cell id, ex ‘A1’
t – is the attribute for type, if it equals ‘s’ this is a string

Usage


Leave a Reply

Your email address will not be published. Required fields are marked *