title: How to detect the last line in awk before END
body: <p>I am trying to add last line to the file which I am creating. How is it possible to detect the last line of a file in awk before <code>END</code> ? I need to do this because the variables don't work in the <code>END</code> block, 
  so I am trying to avoid using <code>END</code>. </p>
  
  <pre><code>awk ' { do some things..; add a new last line into file;}'
  </code></pre>
  
  <p>before <code>END</code>, I don't want this: </p>
  
  <pre><code>awk 'END{print "something new" &gt;&gt; "newfile.txt"}'
  </code></pre>