merge two files based on one column Awk
<p>I am trying to merge two tab delimited files files - which are of unequal lengths. 
I need to merge the files based on column number 1 and get the values from the 3rd column of each file to the new file. If any of the files is missing any id ( uncommon value) then it should get a blank value in the new file - </p>

<pre><code>File1: 
id1 2199 082
id2 0909 20909
id3 8002 8030
id4 28080 80828

File2:

id1 988 00808
id2 808 80808
id4 8080 2525
id6 838 3800

Merged file :

id1 082 00808
id2 20909 80808
id3 8030  
id4 80828 2525
id6   3800
</code></pre>

<p>I went through many forums and posts and so far I have this</p>

<pre><code>awk -F\t 'NR==FNR{A[$1]=$1; B[$1]=$1; next} {$2=A[$1]; $3=B[$1]}1'
</code></pre>

<p>but it does not yield the right result, can anyone please suggest. thanks a lot!</p>