Hello everyone.
I need a Python script that would check two text files, and if the text in the lines matches, then the script would write “Match found” and write the matching text to a new file. If there is no match, then it would write “No matches found.”
Can anyone help?
You can do this using a Bash
if cmp -s file1.txt file2.txt; then echo "Match found" && cat file1.txt > matches.txt; else echo "No matches found." > matches.txt; fi