How can I take the difference between two files?
For example, if I have File1.txt:
And I have File2.txt:
How can I subtract File2.txt from File1.txt to yield File3.txt:
In other words, is there a way to get the Compare plugin to spit-out the differences between files in a separate file? Thanks for any help.
You can use this simple Python script:
file1 = """dog
file2 = """cat
list1 = file1.split()
list2 = file2.split()
diff = set(list1) - set(list2)
If you want to open a file from disk, use something like:
file1 = open("path to file1", "r")
I hope that helps.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.