(imported topic written by zzmhn991)
How would you compare the contents of two files to see which is equal to another based off of line values?
Such as input.txt and output.txt as…
Q: lines of file “c:\output.txt”
Q: lines of file “c:\input.txt”
How can you compare the two files and then report the lines of the file that are equal?
Example =
output.txt would contain:
10.10.10.1
10.10.10.15
10.10.10.121
10.10.10.130
10.10.10.5
input.txt would contain:
10.10.10.1
10.10.10.16
10.10.10.124
10.10.10.132
10.10.10.5
Therefore after comparing the lines of each file the output of equal values would report: 10.10.10.1 and 10.10.10.5.
Can this be done with the lines statement or is there another approach in comparing two files and their contents?
Thank you.