I'd like to permanently delete those rows that are empty have no data of any type! I am doing this like:
private void shift(File f){
File F=f;
HSSFWorkbook wb = null;
HSSFSheet sheet=null;
try{
FileInputStream is=new FileInputStream(F);
wb= new HSSFWorkbook(is);
sheet = wb.getSheetAt(0);
int rowIndex = 0;
int lastRowNum = sheet.getLastRowNum();
if (rowIndex >= 0 && rowIndex < lastRowNum) {
sheet.shiftRows(rowIndex, lastRowNum, 500);
}
FileOutputStream fileOut = new FileOutputStream("C:/juni.xls");
wb.write(fileOut);
fileOut.close();
}
catch(Exception e){
System.out.print("SERRO "+e);
}
}
after shiftRows() i write my new file. But my code has now effect. I just need to remove/delete the empty rows that come inside my data (any ever). so is it possible doing so? if yes, am i doing right? if no can anybody please help me doing so? Thanks in advance!