yeah it SHOULD match 'string 4' (on all occurences in file2) IF it contains any lines from file1.txt. if you put '123 string 4' inside of file 2, then it should take '123' from file one, and match the same '123' in file2. then you get the value directly to the right of the match (in file2) and compare it with the whole of file2, if the value to the right of '123' is 'string 4' then it will most def need to match if 123 is in file1, which obviously is. in essence you are trying to filter the file2.txt and you could say it could be like a database or something. anyway thanks for post replying :)