First script compares 2 text files, [login to view URL] and [login to view URL] . File1 contains a list of phrases (1 phrase per line, phrase can be any number of words). File2 contains a list of words or phrases (1 phrase per line). The .py Python script should compare the phrases in [login to view URL] to phrases in file1.txt. The script must REMOVE any lines from [login to view URL] which contain any exact word/phrase in file2.txt.
E.g. [login to view URL], 'text' stands for random text
text text word1
text word2
text text text word3
word4 text text
text word5 text
[login to view URL]
dog text text
cat
fish text
text bread
word4
word2
egg
very excellent word5
The output file would be
text text word1
text text text word3
text word5 text
Since word2, word4 appear in file2.txt. Note that the match must be exact for it to be removed from the [login to view URL] . For example,
although word5 appears in [login to view URL], it is in the form 'very excellent word5' , and since 'very excellent word5' does not appear in [login to view URL],
it is not removed from file1.txt.
If no words/phrases are in [login to view URL] which are in [login to view URL], then the output is the same as [login to view URL] .
------
Second script will compare [login to view URL] and [login to view URL], but this time, the output file would output lines from [login to view URL]
which contain exact word/phrases from [login to view URL], rather than deleting them. So the output from the above example is:
text word2
word4 text text
Basically the inverse output of the first script. Instead of deleting those words from [login to view URL] and outputting that, instead
it outputs the words that it would have deleted in the first script.
------
I hope I have explained this well enough, it's not as complicated as it sounds.