I have a text file1 that has some id's like:
  c10013_g2_i1|m.63|vomeronasal type-1 receptor 4-like  
  c10015_g1_i1|m.409|vomeronasal type-1 receptor 1-like
I used grep '^[^|]*' file1 to extract the string before | from file1.  
I want each of this greped string to match lines from another file2 and return the whole line when matched. file2 looks like this:  
  c10013_g2_i1  781 622.2   73  5.95    5.16  
  c10014_g1_i1  213 58.67   3   2.59    2.25  
  c10014_g2_i1  341 182.35  4   1.11    0.96  
  c10015_g1_i1  404 245.23  16  3.31    2.87  
  c10017_g1_i1  263 105.37  6   2.89    2.5 
Finally the result should look like:
c10013_g2_i1|m.63|vomeronasal type-1 receptor 4-like 781    622.2   73  5.95    5.16  
c10015_g1_i1|m.409|vomeronasal type-1 receptor 1-like 404   245.23  16  3.31    2.87
 
     
     
     
    