title: Match strings in 2 files and return the line above in file 2 if they match
body: <p>I have a list of email addresses in file 1 and I am trying to lookup those email addresses (from file 1) in file 2. If the email address is in file 2, I want it to return the line above it, which is their username. For example:</p>
  
  <p>Here is file 1:</p>
  
  <pre><code>test@test.com
  bob@test.com
  sally@test.com
  eve@test.com
  </code></pre>
  
  <p>Here is file 2:</p>
  
  <pre><code>testing
  test@test.com
  robert
  bob@test.com
  sally
  sally@test.com
  eve92
  eve@test.com
  </code></pre>
  
  <p>I want the output to be:</p>
  
  <pre><code>testing
  robert
  sally
  eve92
  </code></pre>
  
  <p>I am looking into <code>awk</code>, but can't seem to figure it out. Any thoughts on how best to do this? Willing to do it through bash or python or really whatever you think is best. Thanks!</p>