I have 2 txt files.
File A:
jack john jim
george colin stan
File B:
hell jack john jim goad tiger
tall jack jim john filer dom
hell george colin jim stab tiger
track jack george colin stan forever
I want that each line of file A is checked with every line of file B word by word and return true if there are consecutive matches. Eg
jack from first file A is taken and checked with first line of file B, if found then john is checked and then jim. then we move second line of file B and so on. After that we move on to second line of file A and repeat the process.It will return true only if the matches are consecutive so first line of file B will return True because jack john and jim are in order but second line of file B will return false because they are not in right order.
I have to take it as word by word and will not treat the whole line as a string, so it has to be broken into words and then compared word by word..