Actually, using a for loop am reading these data.
File excel = new File ("C:/test.xlsx");
FileInputStream fis = new FileInputStream(excel);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet ws = wb.getSheetAt(0);
int rowNum = ws.getLastRowNum() + 1;
int colNum = ws.getRow(0).getLastCellNum();
String [][] data = new String [rowNum] [colNum];
for(int i = 1; i <rowNum; i++)
{
XSSFRow row = ws.getRow(i);
System.out.println ("the first value " + row.getCell(1).toString());
System.out.println ("the second value " + row.getCell(2).toString());
}
This gives me output as;
the first value A
the second value PASS
the first value A
the second value PASS
the first value A
the second value FAIL
the first value B
the second value PASS
the first value B
the second value PASS
the first value B
the second value PASS
MATRIX LOOKS LIKE
A PASS
A PASS
A FAIL
B PASS
B PASS
B PASS
I want to add more loops to filter the data as, data containing A has any thing FAIL status then output of that will be A FAIL
again if next set of data containing the same name should check the status if all are in PASS condition then resultant should be B PASS.
the over all output should look like
A FAIL
B PASS
using this in loop;
System.out.println ("the first value " + row.getCell(1).toString());
System.out.println ("the second value " + row.getCell(2).toString());
Its just filtering data from the given data.
Thanks