title: awk: filter a file with another file
body: <p>I'm trying to filter a file with another file. 
  I have a file d3_tmp and m2p_tmp; They are as follows:</p>
  
  <pre><code>$ cat d3_tmp 
  0x000001     0x4d    2
  0x1107ce     0x4e    2
  0x111deb     0x6b    2
  
  $ cat m2p_tmp 
  mfn=0x000001 ==&gt; pfn=0xffffffffffffffff
  mfn=0x000002 ==&gt; pfn=0xffffffffffffffff
  mfn=0x000003 ==&gt; pfn=0xffffffffffffffff
  </code></pre>
  
  <p>I want to print out the lines in m2p_tmp whose second column is not equal to the first column of d3_tmp. (The files are split with \t and =)</p>
  
  <p>So the desired result is:</p>
  
  <pre><code>  mfn=0x000002 ==&gt; pfn=0xffffffffffffffff
    mfn=0x000003 ==&gt; pfn=0xffffffffffffffff
  </code></pre>
  
  <p>However, after I use the following awk command:</p>
  
  <pre><code>awk -F '[\t=]' ' FNR==NR { print $1; a[$1]=1; next } !($2 in a){printf "%s \t 0\n", $2}'     d3_tmp  m2p_tmp 
  </code></pre>
  
  <p>The result is: </p>
  
  <pre><code>0x000001  
  0x1107ce  
  0x111deb  
  0x000001     0
  0x000002     0
  0x000003     0
  </code></pre>
  
  <p>I'm not sure why "$2 in a" does not work. 
  Could anyone help? </p>
  
  <p>Thank you very much!</p>