I'm working on a little app with Java on Netbeans, and I need to export the data of Excel file to an array and then work on this array. To get the excel I use Apache POI and I can show the value of the excel file in the consol.
However, I need to put it in an array, and for the moment I don't know how to work with the Iterator because I am getting the excel data into an iterator.
Workbook workbook = WorkbookFactory.create(new File(pathConfig1));
//File
Iterator<Sheet> sheetIterator = workbook.sheetIterator();
Sheet sheet = workbook.getSheetAt(nbSheet1);
//Get index sheet user
Iterator<Row> rowIterator = sheet.rowIterator();
int nbLine= sheet.getLastRowNum() +1;
//Number of Lines
int nbCol = sheet.getRow(0).getLastCellNum();
// Number of columns
String [][]data= new String[nbLine][nbCol];
//Array for the data
From this point I don't really know how to export the data in my array... Any idea ?
I thought to use 2 loop for but I don't know how to increment my Iterator...