title: Comparing two columns in two files using awk
body: <p>I'm trying to compare two different files, let's say "file1" and "file2", in this way.
  If fields $2 and $3 are the same in both files, print $0 of file2. Here's an example:</p>
  
  <pre><code>file1
  E 352 697 
  E 25 692
  E 510 744
  
  file2
  E 335 705 1 1
  E 267 792 1 2
  E 365 395 1 3
  E 25 692 1 4
  E 566 624 1 5
  E 227 358 1 6
  E 516 554 1 7
  E 510 744 1 8
  E 234 790 1 9
  E 352 697 1 10
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>E 352 697 1 10
  E 25 692 1 4
  E 510 744 1 8
  </code></pre>
  
  <p>Notice that all couples $2,$3 in file1 are contained in file2 and the number of rows of the output file is the same of file1.
  There are a lot of questions with similar problems, I know that, but all the answers were not useful. 
  I have tried to use:</p>
  
  <pre><code>awk 'FNR==NR {a[$2]; b[$3]; next} $2 in a &amp;&amp; $3 in b' file1 file2 &gt; output
  </code></pre>
  
  <p>It works but in the output file there are extra rows. Could you help me? Thanks!</p>