title: Print strings of file1 that appears in file2 in awk
body: <p>I want to print the programming languages in file1 that appears in file2, its corresponding line number in file2 and the complete line of file2.</p>
  
  <p>file1 is like this:</p>
  
  <pre><code>Ruby
  Visual Basic
  Objective-C
  C
  R
  C++
  Basic
  </code></pre>
  
  <p>file2 is like this:</p>
  
  <pre><code>5. ab cde fg Java hij kl
  2. ab PHP dddf llf 
  4. cde fg z o Objective-C oode
  8. a12b cde JavaScript kdk
  6. ab99r cde Visual Basic llso dkd
  1. lkd dsk Ruby kksdk
  3. Python dsdls
  9. CSS dkdsk
  4. Jdjdj C Jjd Kkd
  12. Iiii Jjd R Hhd
  5. Jjjff C++ jdjejd
  7. Jfjfjdoo Uueye Basic Jje Tasdk
  </code></pre>
  
  <p>I´d like to get this output:</p>
  
  <pre><code> 6|Ruby|1. lkd dsk Ruby kksdk
   5|Visual Basic|6. ab99r cde Visual Basic llsodkd            
   3|Objective-C|4. cde fg z o Objective-C oode
   9|C|4. Jdjdj C Jjd Kkd  
   10|R|12. Iiii Jjd R Hhd 
   11|C++|5. Jjjff C++ jdjejd
   12|Basic|7. Jfjfjdoo Uueye Basic Jje Tasdk 
  </code></pre>
  
  <p>where 6,5 and 3 are the line number where "Ruby", "Visual Basic" and "Objective-C" appears within file2.</p>
  
  <p>I've tried so far with the code below, but this code works only if file 2 has a list of exact matches when comparing with file1.</p>
  
  <pre><code>awk 'NR == FNR{a[$0];next} ($0 in a)' file1 file2
  </code></pre>
  
  <p>In this case the programming languages in file2 have some text before and after and I'm stuck in how to get the output i want.</p>
  
  <p>Thanks in advance for any help. </p>