This class has the function of saving the data in an excel file to an array. But you are not. Does anyone know me know why? I've already asked about the genre before but I can not edit it.
public class uni {
public static void main (String[] args) throws IOException{
String[][] mat_Excel = new String[60][20];
File excel = new File("gestao.xlsx");
FileInputStream fich = new FileInputStream(excel);
//através de biblioteca Poi da apache podemos ler o ficheiro excel
XSSFWorkbook workbook = new XSSFWorkbook(fich);
//temos acesso à folha de excel
XSSFSheet sheet = workbook.getSheetAt(0);
//iteramos as row da folha de excel
Iterator<Row> rowIt = sheet.iterator();
int linha=0, coluna=0;
while(rowIt.hasNext()){
Row row = rowIt.next();
//iteramos células que estão exatamente nesta row
Iterator<Cell> cellIterator = row.cellIterator();
while(cellIterator.hasNext()){
Cell cell = cellIterator.next();
mat_Excel[coluna][linha] = cell.toString();
//System.out.print(cell.toString() + ";");
linha++;
}
coluna++;
}
System.out.println(Arrays.toString(mat_Excel));
System.out.println(Arrays.deepToString(mat_Excel));
workbook.close();
fich.close();
}
}