title: remove newlines while keeping newlines followed by another newline
body: <p>I have this text file with a lot of SQL queries. I need each query on a single line.
  The queries are separated by 2 newlines for e.g. /n/n while the query itself may have single /n</p>
  
  <p>Input file:</p>
  
  <pre><code>select * from 
  table A 
  where name = 'abc'
  
  drop table A;
  
  update table a
  inner join b on a.name = b.name
  
  fourth query
  continue
  
  fifth query
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>select * from table A where name = 'abc'
  
  drop table A;
  
  update table a inner join b on a.name = b.name
  
  fourth query continue
  
  fifth query
  </code></pre>
  
  <p>I tried this, but it prints everything on one line.</p>
  
  <blockquote>
    <p>awk '/\n/ {printf "\n%s\n",$0;next} {printf "%s ",$0}' report41.txt</p>
  </blockquote>
  
  <p>I have found this pattern...</p>
  
  <p><a href="https://regex101.com/r/qNQRk5/4" rel="nofollow noreferrer">https://regex101.com/r/qNQRk5/4</a></p>
  
  <p>But there are 2 problems. 1) I do not know how to use it in AWK and 2) the query does not contain space.</p>
  
  <blockquote>
    <p>update table ainner</p>
  </blockquote>
  
  <p>Should be:</p>
  
  <blockquote>
    <p>update table a inner</p>
  </blockquote>