You labeled your columns wrong in the post above.
Here is a rough example that displays the rows of file 2 where:
-- the first element (A) of file 1 matches the first element (X) of file 2
-- AND
-- the fifth element (E) of file 1 matches the fourth element (T) of file 2
Note the duplicates in the example.