title: How to remove a row using apache poi
body: <p>I tried to remove the third row</p>
  
  <p>THIS IS THE EDIT I made based on the comments of rgettman, Leo, zibi. Thank you. </p>
  
  <pre><code>public class MainTest {
  
      public static void main(String[] args) throws IOException {
  
          FileInputStream file  =   new FileInputStream(new  File("test.xlsx") );
          XSSFWorkbook wb = new XSSFWorkbook(file);
          XSSFSheet sheet = wb.getSheetAt(0);
          sheet.removeRow(sheet.getRow(3));
  //      sheet.shiftRows(3, 3, -1);
  
          File outWB = new File("testResult.xlsx");
          OutputStream out = new FileOutputStream(outWB);
          wb.write(out);
          out.flush();
          out.close();
  
  
          System.exit(0);
      }
  
  }
  </code></pre>
  
  <p>But this deletes values in a row but does not remove the row</p>