title: awk regular expression print every N occurence
body: <p>I would like to understand awk a little better: I often search for regular expressions and many times I am interested only in the Nth occurrence. I always did this task using pipes say:</p>
  
  <pre><code>awk '/regex/' file | awk 'NR%N==0' 
  </code></pre>
  
  <p>How can I do the same task with <code>awk</code> (or <code>perl</code>) <strong>without piping</strong>? </p>
  
  <p>Are there some instances in which using pipes is the most computationally efficient solution? </p>