How to compare two text files and output the difference in Windows 7?

SpecialOne

Registered Member
Joined
Jan 12, 2011
Messages
65
Reaction score
21
I need a Windows tool which can compare 2 files in .txt format and output the difference. It should also work with large files. Example below:


Text1.txt

Apple
Orange
Banana

Text2.txt

Apple
Orange
Banana
Lemon

Output.txt

Lemon

So how could I do this in Windows without using that "grep" tool which is Linux thing? I am also working with large files 100k rows.
I tried this but it couldn't load my files properly: http://www.sobolsoft.com/comparetextline Also textmechanic.com doesn't seem to have this kind of tool.
 
If it isn't too large you can also use online tools like this one:
text-compare [DOT] com
 
If you want, I can just code up a small php script which will handle it up for you, for FREE ofcourse.



  • Store lines into arrays, and run array_diff(). Save the new array. Done!


Having it done by a desktop tool would be much faster though. If nothing works, you can try the PHP way.
 
I ended up using our Swiss Army Knife a.k.a. Scrapebox --> Import URL lists --> Select the URL lists to compare option. Problem is that I am comparing two large files with text strings which are not URLs. Scrapebox is only accepting URLs when importing into harvester. Had to add suffix .com at the end of each line using textmechanic.com and then import them into Scrapebox. After comparing I had to remove .com sufix again in notepad. A lot of babysitting for simple task as this.

I found this website http://shiplu.mokadd.im/36/fastes-way-to-find-difference-of-very-large-php-arrays/

Maybe Repulsor or somebody with great PHP coding skills could share something like this to the community, if not time consuming of course.
 
I use a tool called Diff-Merge...works great for me but I don't know about what you're doing?
 
Cygwin Terminal (64 Bit) - it has its own learning curve, but its not rocket science! spend like 30 minute googling how to use it and you will find out!
 
Back
Top