file1 contents: 1. Ram/is/going/reg[30] 2. he/is/coming/reg[31] 3. what/goes/on/reg[32] file2 contents: 1. is/coming/reg[31] 2. on/reg[32] 3. try/to/do/reg[65] output file contents: Ram/is/going/reg[30]