Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

315
Vistas
How to replace blank cell values with a word in excel Java POI

enter image description here

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");
   }                          
  }
  }
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Without your code, its hard to figure out. Sample code

CellReference cr = new CellReference(entry.getKey());
int r = cr.getRow();
int c = cr.getCol();

Row row = sheet.getRow(r);
if (row == null)
    row = sheet.createRow(r);
Cell cell = row.getCell(c, Row.CREATE_NULL_AS_BLANK);
cell.setCellValue("Not Available");
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda