poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew C. Oliver" <acoli...@apache.org>
Subject Re: event model vs iterating over rows
Date Wed, 16 Jul 2003 01:46:14 GMT
The rows are returned in the order in which they are in the file.  There is
NOTHING to guarantee that the row records will be before the cell records,
group the cell records, etc.  You must just process cell and row records
wherever they pop up independently as any order is valid.  You could make
some assumptions that would work "most of the time" but its not the 90
sheets you read that people remember, its the 10 you don't.

For CSV, you'll probably need to add cells to some kind of data structure.
Basically a 2 dimensional array or List of some kind then iterate over
supposing you wish to use the event model.


On 7/15/03 6:51 PM, "Brook Stevens" <bstevens@Cleanwise.com> wrote:

> I am new to POI so please excuse me if this is a stupid question.
> I am trying to write a very simple excel reader that essentially will
> process information row by row, and could be potentially large files.  The
> way I would do this with a csv file (which is what I am replacing) is to
> simply read in each row.  I looked at the example on Javaworld which seems
> to do this, but mentions that the event model is better, fine so now I am
> looking at using the event model.  My issue is that I don't really
> understand if with the event model everything is in the order that I expect
> it to be... i.e. if the last record was in row 2 and the record I am
> processing now is in row 3 will there be any subsequent records in row 2.
> Or do I need to read in the entire file before I am positive that I have
> everything in row 2.  And if that is the case would it just be better to
> iterate over the rows.
> Hope I am making some sense, thanks.
> Brook

Andrew C. Oliver
Custom enhancements and Commercial Implementation for Jakarta POI

For Java and Excel, Got POI?

View raw message