I have two files, file1 and file2file1:  r11_abc_gkhsa 1.0 1.5 1.9  r11_bcd_gkhsa 1.0 1.5 1.7  r11_acd_gkhsa 1.3 1.6 1.5  r11_xyz_gkhsa 1.0 1.5 1.9file2:  sd1_bcd_gkhsa 1.8 1.5 1.9  ab1_abc_gkhsa 1.6 1.4 1.5  sfs_xyz_gkhsa 1.4 1.6 1.4  sd1_acd_gkhsa 1.2 1.3 1.5  sfs_ryb_gkhsa 1.5 1.2 1.7I want to match  abc , bcd, acd, and xyz of file1 with file2. Whenever it matched with file2 I want to print it the following way.Output: r11_abc_gkhsa 1.0 1.5 1.9     ab1_abc_gkhsa 1.6 1.4 1.5 r11_bcd_gkhsa 1.0 1.5 1.7     sd1_bcd_gkhsa 1.8 1.5 1.9 r11_acd_gkhsa 1.3 1.6 1.5     sd1_acd_gkhsa 1.2 1.3 1.5 r11_xyz_gkhsa 1.0 1.5 1.9     sfs_xyz_gkhsa 1.4 1.6 1.4  sfs_ryb_gkhsa 1.5 1.2 1.7can use Perl or sed. can someone give me ideas to work on it.
I want to compare and match two files and print them into one file
sed;perl