Okay, so given this is it still better to use the event model or is iterating over the rows going to be better preformance wise, or is it a ratio based on the file size?
Thanks, Brook > -----Original Message----- > From: Andrew C. Oliver [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 15, 2003 9:46 PM > To: POI Users List > Subject: Re: event model vs iterating over rows > > > 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. > > -Andy > > On 7/15/03 6:51 PM, "Brook Stevens" <[EMAIL PROTECTED]> 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 > http://www.superlinksoftware.com/poi.jsp > Custom enhancements and Commercial Implementation for Jakarta POI > > http://jakarta.apache.org/poi > For Java and Excel, Got POI? > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
