title: How to add the record count at end of the file using awk
body: <p>I have file like below </p>
  
  <pre><code>H|ACCT|EXEC|1|TEMP|20130215035845|
  849002|48|1208004|1
  849007|28|1208004|1
  855003|48|1208004|1
  855004|28|1208004|1
  855006|28|1208004|1
  855008|28|1208004|1
  855011|28|1208004|1
  </code></pre>
  
  <p>I want to add record count -1 (because first record is not the part of the hole records)
  I need output as below</p>
  
  <pre><code>H|ACCT|XEC|1|TEMP|20130215035845|
  849002|48|1208004|1
  849007|28|1208004|1
  855003|48|1208004|1
  855004|28|1208004|1
  855006|28|1208004|1
  855008|28|1208004|1
  855011|28|1208004|1
  T|7
  </code></pre>
  
  <p>I tried below option <code>awk 'NF != 0 {++count} END {print count}</code>
  But it is not writing at end of the file, how to calculate and add the result.</p>