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?
comm -12 <(sort "$1") <(sort "$2")
or
# command line parameters:
# $1 input: file with patterns to search for
# $2 input: file in which you search for patterns
# $3 output: file to which put found matches
grep -a -Ff "$1" "$2" > "$3"