Ok I understand.
I don't think there is a direct way to iterate over the cells of a column
because of the object model of POI (inherited from MS Excel ?)
There is no column concept in POI so you'll have to iterate over rows and
pick the cell of the column you want.
The problem I think is that you can have rows with different number of
cells.
Pierre
On Tue, Oct 14, 2008 at 9:48 AM, Hardie82 <[EMAIL PROTECTED]>wrote:
>
> Thanks, but with your code you iterate over each cell in a row and than
> goto
> next row an so on. But i want to iterate over a column meaining get each
> cell of a column and than goto next column and so on. I gooled for the
> problem and find only solutions like yours. So it seem there is no other
> way
> as doing so :(. If anyone else has the solution for the problem please post
> it to us.
>
> Hardie
>
>
>
> Pierre Lavignotte wrote:
> >
> > I use the following code :
> >
> > int lastRowNum = sheet.getLastRowNum();
> > // Browse rows
> > for (int rowIndex=0; rowIndex<=lastRowNum; rowIndex++) {
> >
> > HSSFRow row = sheet.getRow(rowIndex);
> >
> > int lastCellNum = row.getLastCellNum();
> >
> > // Browse cells
> > for (int cellIndex=0; cellIndex<=lastCellNum; cellIndex++) {
> >
> > HSSFCell cell = row.getCell(cellIndex);
> > }
> > }
> >
> >
> > On Tue, Oct 14, 2008 at 9:09 AM, Hardie82
> > <[EMAIL PROTECTED]>wrote:
> >
> >>
> >> Hi. Iam also interessted for a simple way to get the number of the
> >> columns
> >> without iterating rows. Is there a solution for this? I searched the
> >> sheet-class in the api but didn't found a method for it.
> >>
> >> Hardie
> >>
> >>
> >> Kalkunda, Venkat wrote:
> >> >
> >> > Hi,
> >> >
> >> > My name is Venkat. I am working on a project which is using the=20
> >> > http://jakarta.apache.org/poi/apidocs API? I would appreciate any
> help
> >> > tha=
> >> > t I can get.
> >> >
> >> >
> >> > Can somebody tell me, if there is a method or a way to find out the
> >> number
> >> > =
> >> > of rows and the number of columns that have been populated with
> >> > values(like=
> >> > text, integer or formula, etc.) in the Excel workbook?
> >> > Thank You
> >> >
> >> > Thank You
> >> > Kalkunda Venkat
> >> > GFRIS - Principal Financial Group
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Row-Column-number%21%21%21-tp530660p19968118.html
> >> Sent from the POI - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Cordialement,
> > Pierre Lavignotte
> > Ingénieur Conception & Développement
> > http://pierre.lavignotte.googlepages.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Row-Column-number%21%21%21-tp530660p19968610.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Cordialement,
Pierre Lavignotte
Ingénieur Conception & Développement
http://pierre.lavignotte.googlepages.com