I need help in getting the data into 2D array from excel sheet. I am aware on how to get the data from excelsheet into 1D array. Could you please help on the same?
All I have is the below excel sheet
Below code works fine to fetch single column data but I would like to fetch both mentioned columns data into a 2D Array . Could you please help?
Object excelD= ExcelFactory.getExcelDataWithDefaultSheet(‘D:\Users\Test.xlsx’,
sheet1, true)
for (int i = 1; i <= tot; i++) {
if (excelData.getValue(‘Pname’, i) == ‘’) {
break
}
@kazurayam
This code works for 1D array. This is able to get both column data into one array . I need the data in the table format into below defined array(2D)
ArrayList[][] ExlPgm= new ArrayList[numRows][];
As mentioned above
“This code works for 1D array. This is able to get both column data into one array . I need the data in the table format into below defined array(2D)”
List<List> exlPgm = new ArrayList<ArrayList>()
So if I have the above 2D array defined and want to fetch the data from the excel sheet mentioned above then what is the way to do it ?