title: Set number of lines to variable in awk
body: <p>I am experimenting with an awk script (an independent file).
  I want it to process a text file which looks like this:</p>
  
  <pre><code>value1: n
  value2: n
  value3: n
  value4: n
  value5: n
  value6: n
  value7: n
  
  value1: n
    :
  </code></pre>
  
  <p>The text file contains a lot of these blocks with 7 values in each of them. I want the awk script to print some of these values (name of the value and "n") into a new file or the commandline. I thought I'd process it with a while loop, which works with a variable set to the number of all lines. But I just cant get the total of all lines in the file into a variable. It seems I have to process every line and do something with it until the end of the file to get the total. But I'd like to have the total in a variable and then process it with the while loop which loops until the total is reached.</p>
  
  <p>Do you have an idea?</p>