title: counting non blank lines per block of a file, having several blocks separated by a blank line
body: <p>I'd like to count lines in a file that consists of several blocks, say 3, each with a different number of lines. Each block is separated by a blank line. Is there a one line solution? 
  So far here is what I have:</p>
  
  <p>awk '(NR>4) &amp;&amp; NF!=0 {++count} END {print count}' filename > outfile</p>
  
  <p>This obviously counts all non-blank lines (and gets rid of a 4-line header). I now have to include a for loop and after each run it should print the number of lines.</p>
  
  <p>So if I have 100 non-blank lines, and the first block contains 20 lines, the second 50 and the third 30 lines, the ideal output would be 20 50 30</p>
  
  <p>All my effort so far had syntax errors.</p>
  
  <p>Thanks for your help
  Tom</p>