Reputation: 11325
Right now I'm iterating through all rows and finding the index, then if the index is within bounds, I do something with it
for (Row r: sheet) {
if(r.getRowNum()>x)
Cell cell = r.getCell(1);
something something something
}
But is there a way to iterate through a specific range without having to go through the comparison?
Upvotes: 2
Views: 6543
Reputation: 86774
A HSSFSheet
object has a getRow(int index)
method you can use to retrieve any row.
for (int i=start_row; i<=end_row; i++)
{
HSSFRow = sheet.getRow(i);
something something something
}
Upvotes: 4