title: awk FNR==NR, ORS, OFS confused
body: <p>Please help me to understand the logic behind the function. I am little bit confused to understand it.</p>
  
  <p>myscript:</p>
  
  <pre><code>generate_exception(){
      awk -F "," 'FNR==NR{a[ins,INS]=ins "," INS;next}{ if (!a[ins,INS]) print $0,"is not available"}' OFS="," my_$1_lookup.csv final.csv &gt;&gt; exception.csv
  }
  
  generate_exception ins INS
  </code></pre>
  
  <h2>my_ins_lookup.csv</h2>
  
  <pre><code>STANDARD &amp; POORS,XS00001,ISS ILN,SG CORP
  STANDARD &amp; POORS,XS00002,ISS ILN,SG CORP
  STANDARD &amp; POORS,XS00003,PM,US CORP
  STANDARD &amp; POORS,XS00004,LMT,US CORP
  STANDARD &amp; POORS,XS00005,NAT,FR CORP
  </code></pre>
  
  <h2>final.csv</h2>
  
  <pre><code>MOODYS,USEQ27,N.A.
  STANDARD &amp; POORS,XS00001,N.A.
  MOODYS,SGD,NR
  STANDARD &amp; POORS,XS00004,N.A.
  </code></pre>
  
  <h2>Here is my understanding:</h2>
  
  <p>FS: FIELD SEPARATOR (DEFAULT SPACE)</p>
  
  <p>NF: NUMBER OF FIELDS IN THE CURRENT RECORD</p>
  
  <p>NR: NUMBER OF CURRENT RECORDS</p>
  
  <p>NR: It represents the number of the current record. For instance, the following example prints the record if the current record contains less than three fields.</p>
  
  <p>FNR: It is similar to NR, but relative to the current file. It is useful when 
  AWK is operating on multiple files. Value of FNR resets with new file.</p>
  
  <p>ORS: It represents the output record separator and its default value is newline.</p>
  
  <p>OFS: It represents the output field separator and its default value is space.</p>