mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Add an openSheet(index) method
This commit is contained in:
@ -76,6 +76,23 @@ public class XlsxFileToRows extends AbstractIteratorBasedFileToRows<org.dhatim.f
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
** open/go-to a specific sheet (by 0-based index). resets rows & iterator.
|
||||||
|
***************************************************************************/
|
||||||
|
public void openSheet(int index) throws IOException
|
||||||
|
{
|
||||||
|
Optional<Sheet> sheet = workbook.getSheet(index);
|
||||||
|
|
||||||
|
if(sheet.isEmpty())
|
||||||
|
{
|
||||||
|
throw (new IOException("No sheet found for index: " + index));
|
||||||
|
}
|
||||||
|
|
||||||
|
rows = sheet.get().openStream();
|
||||||
|
setIterator(rows.iterator());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
**
|
**
|
||||||
|
Reference in New Issue
Block a user