title: Left outer join of multiple files data using awk command
body: <p>I have base file and multiple files having common data based on 1st field of base file. I need output file with combination of all data. I have tried many commands due to file size taking to much time for output many times awk helps me out but i don't have any idea of awk array programing
  example</p>
  
  <p><strong>Base File</strong> </p>
  
  <pre><code>aa
  ab
  ac
  ad
  ae
  </code></pre>
  
  <p><strong>File -1</strong></p>
  
  <pre><code>aa,Apple
  ab,Orange
  ac,Mango
  </code></pre>
  
  <p><strong>File -2</strong> </p>
  
  <pre><code>aa,1
  ab,2
  ae,3
  </code></pre>
  
  <p><strong>Output File expected</strong></p>
  
  <pre><code>aa,Apple,1
  ab,Orange,2
  ac,Mango,
  ad,,
  ae,,3
  </code></pre>
  
  <p>This is what I tried:</p>
  
  <pre><code>awk -F, 'FNR==NR{a[$1]=$0;next}{if(b=a[$1]) print b,$2; else print $1 }' OFS=, test.txt test2.txt
  </code></pre>