title: Grep file with two columns as input
body: <p>I have a file containing lines like:</p>
  
  <pre><code>"ALMEREWEG               ";" 45  ";"      ";"ZEEWOLDE                ";"3891ZN"
  "ALMEREWEG               ";" 50  ";"      ";"ZEEWOLDE                ";"3891ZP"
  "ALMEREWEG               ";" 51  ";"      ";"ZEEWOLDE                ";"3891ZN"
  "ALMEREWEG               ";" 52  ";"      ";"ZEEWOLDE                ";"3891ZP"
  "ALMEREWEG               ";" 53  ";"      ";"ZEEWOLDE                ";"3891ZN"
  </code></pre>
  
  <p>and I have a second file containing lines like:</p>
  
  <pre><code>3891ZP;50;
  3891ZN;53;A
  3891ZN;53;B
  3891ZN;54;
  </code></pre>
  
  <p>Now I want to grep the first file based on the pattern of the second file, where:</p>
  
  <p>A) the 1st column of the 2nd file is present in the 5th column of the 1st file; and</p>
  
  <p>B) the 2nd column of the 2nd file is present in the 2nd column of the 1st file.</p>
  
  <p><strong>My question: how to do this?</strong></p>
  
  <p><strong>Update 7 July 2013:</strong> I updated file2 format to reflect the third column (number suffices).</p>