title: awk Compare 2 files, print match and difference
body: <p>I need to comapre two files f1.txt and f2.txt and obtain matches, and non-matches, for this case I am looking to match first field on both files. And print first the second field of f2.txt, then print the entire line of f1.txt. And for no match found on f2.txt to state "Not Found" and then print f1.txt entire line. </p>
  
  <p>F1.txt</p>
  
  <pre><code>1;2;3;4;5;6;7;8
  1a;2;3;4;5;6;7;8
  1b;2;3;4;5;6;7;8
  2b;2;3;4;5;6;7;8
  </code></pre>
  
  <p>F2.txt</p>
  
  <pre><code>1;First
  1a;Firsta
  1b;Firstb
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>First;1;1;2;3;4;5;6;7;8
  Firsta;1a;1a;2;3;4;5;6;7;8
  Firstb;1b;1b;2;3;4;5;6;7;8
  Not Found;2b;2;3;4;5;6;7;8
  </code></pre>
  
  <p>I am able to obtain the matches but not the non match</p>
  
  <pre><code>awk -F ";" -v OFS="";"" "NR==FNR{a[$1]=$2;next}a[$1]{print a[$1],$0}" f2.txt f1.txt
  </code></pre>
  
  <p>Thanks</p>