title: How does the next command actually function
body: <p>I get (FILENAME=123.dat FNR=2) fatal: division by zero attempted error in the following script. Doesn't the next command ignore the following two blocks of code and start executing the code for the 2nd record. If that isn't the case how can I ïgnore any code execution on the first record of a file?</p>
  
  <pre><code>awk ' BEGIN {
  
  FS="&lt;[^&gt;]+&gt;"; 
  RS="";
  review1=1;
  review2=1;
  rating=0;
  criteria=7;
  
  
  }
  
  #ignores the first record of each file
  FNR&lt;2 { next }  
  
  FNR==NR {
  
  #sums all the ratings of an authors
  for(i=8; i&lt;=14;i++) {
      rating+=$i;     
  }
  
      #stores the average rating of each author
      sum1+=rating/criterias;
  
      #stores each average rating
      total1[review1]=rating/criteria
  
      review1++;
      rating=0;   
  } 
  
  FNR!=NR {
  
  .... code
  
  }
  
  END {
  
  #calculates the mean(overall rating) for hotel1
  mean1=sum1/review1;
  
  printf("Mean hotel_1: %.2f\n",mean1);
  
  } ' "$2" "$3"
  </code></pre>