title: How insert text into blank lines in any cases?
body: <p>I would like to paste the text from <code>File2</code> into <code>File1</code></p>
  
  <p>File1:</p>
  
  <pre><code>1
  2
  
  4
  5
  
  7
  8
  </code></pre>
  
  <p>File2:</p>
  
  <pre><code>3
  6
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>1
  2
  3
  4
  5
  6
  7
  8
  </code></pre>
  
  <p>As example attempt from this question <a href="https://stackoverflow.com/questions/41503222/insert-text-into-blank-lines-in-bash">Insert text into blank lines in bash</a>:</p>
  
  <pre><code>sed -e '/^$/{R file2' -e 'd}' file1
  </code></pre>
  
  <p>But it works only in case where there is only every second line blank. I would like to ask, it's possible in more complex cases? In other words, is there a universal solution?</p>
  
  <p>As example:</p>
  
  <p>File1</p>
  
  <pre><code>1
  2
  3
  
  5
  6
  
  
  9
  </code></pre>
  
  <p>File2</p>
  
  <pre><code>4
  7
  8
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>1
  2
  3
  4
  5
  6
  7
  8
  9
  </code></pre>