title: Add a column from one file into another file using AWK for a given condition
body: <p>First of all, thank you for your help. I have 2 files which are</p>
  <pre><code>1   10
  2   20
  3   30
  4   10
  5   20
  </code></pre>
  <p>And</p>
  <pre><code>A   10
  B   20
  C   30
  </code></pre>
  <p>I wanto to filter both files using AWK so the if $2 in the first file is equal to the value of $2 in the second file the output will be adding a new column which matches the condition given:</p>
  <pre><code> 1  A   10  
   2  B   20  
   3  C   30
   4  A   10  
   5  B   20  
  </code></pre>
  <p>I have tried this code:</p>
  <pre><code>awk 'FNR==NR{a[NR]=$0;next}{$2=a[FNR]}1' letters.txt numbers.txt &gt;&gt; combined.txt
  </code></pre>
  <p>The problem is that the code only replace one column for the other I want to that the column matches the condition I have given above. Also I want to put the new column between the columns from number.txt file</p>