Sheet mySheet = myWorkBook.getSheetAt(0); /** We now need something to iterate through the cells.**/ Iterator rowIter = mySheet.rowIterator(); while(rowIter.hasNext()) { Row myRow = (XSSFRow) rowIter.next(); Iterator cellIter = myRow.cellIterator(); Vector cellStoreVector=new Vector(); String nextElement=""; while(cellIter.hasNext()) { Cell myCell = (XSSFCell) cellIter.next(); System.out.println("Cell Type is :"+myCell.getCellType()+" | "+myCell.toString()); if(myCell.getCellType()==XSSFCell.CELL_TYPE_BLANK) { System.out.println("Blank data found "); myCell.setCellValue("-"); cellStoreVector.addElement(myCell); } else { cellStoreVector.addElement(myCell); } } System.out.println(""); cellVectorHolder.addElement(cellStoreVector); } } catch (Exception e) { e.printStackTrace(); }
if(""+myCell.toString()=="") { System.out.println("Blank data found "); myCell.setCellValue("-"); cellStoreVector.addElement(myCell); } else { cellStoreVector.addElement(myCell); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)