How can I fill all the blank cells in an excel file with the word "Not Available" using Java Apache POI?
I have used the following code but it only works for some of the columns only I can't figure out what is the reason? To be exact from the 1000nd row it works. (I have a very large excel document)
XSSFRow r1;
for(Row r : firstSheet)
{
r1=(XSSFRow) r;
for (Cell cell : r) {
if(cell == null || cell.getCellType() == Cell.CELL_TYPE_BLANK)
{
XSSFCell cell2 = r1.createCell(cell.getColumnIndex());
cell.setCellValue("Not Available");
}
}
}