Hi,
I'm trying to take two text files, compare them, then output the matches into a new text file. I've read the thread started by the1last, but that's outputting differences, not matches. I just started learning about python a couple days ago, so I don't know anything about what syntax or modules I should use.
Any thoughts or suggestions would be appreciated.
Thanks.
zmjman08
0
Newbie Poster
Recommended Answers
Jump to PostI'm new to Python as well, but I think I could offer some help.
Well if you're looking to find lines that match up, instead of words, then you can do something like this:
file1 = open("file1.txt", "r") file2 = open("file2.txt", "r") file3 = open("file3.txt", "a") …
All 11 Replies
Zebibyte
0
Newbie Poster
sravan953
zmjman08
0
Newbie Poster
sravan953
zmjman08
0
Newbie Poster
zmjman08
0
Newbie Poster
eldeingles
0
Newbie Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
eldeingles
0
Newbie Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
eldeingles
commented:
Quick, well explained and most helpful!!
+0
santosh2430
0
Newbie Poster
TrustyTony
commented:
Do not hijackold thread, make your own and link to old
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.