Can I read a excel sheet column wise using apache poi..?(without using row Iterator)
for (Row row : sheet) {
Cell firstCell = row.getCell(0);
// Printing Stuff
}
I know, the above one will do the same. But I need to get first column's data without using Row Iterator.
You can iterate over the sheet without using iterator
Workbook wb = WorkbookFactory.create(new FileInputStream("file.xls"));
Sheet sheet = wb.getSheetAt(0);
for (int j=0; j< sheet.getLastRowNum() + 1; j++) {
Row row = sheet.getRow(j);
Cell cell = row.getCell(0); //get first cell
// Printing Stuff
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With