title: Programmatically delete empty rows
body: <p>This is my sheet</p>
  <p><img src="https://i.stack.imgur.com/prBJ7.png" alt="" /></p>
  <p>As you can see row 2 and 6 are empty because I manually deleted some products. My question is how to programmatically delete those empty rows and be replaced with the other product-filled rows?</p>
  <pre><code>var ss = SpreadsheetApp.openById(&quot;my spreadsheet id&quot;);
  var sheet = ss.getSheets()[0];
  var data = sheet.getDataRange().getValues();
  </code></pre>