In the attached excel, I want read the data and display in the below json
format:
test id : value
desc : value
execution status : value
execution browser : value
Any suggestions ???
i tried below code but it is populating only the first column and its value.
for (int i = 0; i < sheet.getPhysicalNumberOfRows(); i++) {
String cell = sheet.getRow(i).getCell(0).toString();
if (null != cell) {
//String TC_ID = String.valueOf(row.getCell(0));
String data = sheet.getRow(i + 1).getCell(0).toString();
map.put(cell, data);
} else {
break;
}
}
list.add(map);
fis.close();
FileOutputStream output_file = new FileOutputStream(excelPath);
workSheet.write(output_file);
output_file.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}