I would like to know how to iterate and get the list of cell values from excel file first row or specific row in a sheet using java with poi.
Could anyone please help me to know about this...
Thanks in advance,
I would like to know how to iterate and get the list of cell values from excel file first row or specific row in a sheet using java with poi.
Could anyone please help me to know about this...
Thanks in advance,
Very simple:
Workbook workbook = new HSSFWorkbook(); // or: new XSSFWorkbook() - depending on excel version
Sheet sheet = workbook.getSheetAt(i);
Row row = sheet.getRow(j);
Iterator iterator = row.cellIterator();
while(iterator.hasNext()){
Cell cell = (Cell)iterator.next();
// do whatever with cell...
}