Return-Path: Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 93584 invoked from network); 16 Jul 2003 01:46:04 -0000 Received: from unknown (HELO set.superlinksoftware.com) (66.35.175.110) by daedalus.apache.org with SMTP; 16 Jul 2003 01:46:04 -0000 Received: from rdu57-249-152.nc.rr.com ([66.57.249.152]) by set.superlinksoftware.com (JAMES SMTP Server 2.1) with SMTP ID 146 for ; Tue, 15 Jul 2003 20:08:32 -0400 (EDT) User-Agent: Microsoft-Entourage/10.1.0.2006 Date: Tue, 15 Jul 2003 21:46:14 -0400 Subject: Re: event model vs iterating over rows From: "Andrew C. Oliver" To: POI Users List Message-ID: In-Reply-To: <795EA2108E26D41197DD00B0D022C3BC0183090E@CWI> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: X-UID: 120 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" 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?