title: How to add an empty line in text file using shell script?
body: <p>This is my code; the &quot;test.txt&quot; file contains more empty lines and empty space apart from tab. I want to remove that empty space and empty lines as well but I need one empty line before starting <code>st^</code>. How to do it?</p>
  <pre><code>sed &quot;s/^[ ]*//&quot; -i  test.txt
  cat $2 &gt; /tmp/tt.txt
  sed '/^$/d' test.txt &gt; /tmp/tt.txt
  echo &quot; &quot; &gt;&gt; test.txt
  echo &quot; &quot; &gt;&gt;  /tmp/tt.txt
  mv /tmp/tt.txt  test.txt
  </code></pre>
  <p>I am getting output like:</p>
  <pre class="lang-none prettyprint-override"><code>    st^flower
       p^rose
       p^jasmine
      st^animals 
       p^bear
       p^elephant
  </code></pre>
  <p>I want output like:</p>
  <pre class="lang-none prettyprint-override"><code>    st^flower
       p^rose
       p^jasmine
  
      st^animals 
       p^bear
       p^elephant
  </code></pre>