1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Black Hat SEO Tools' started by SpecialOne, Oct 25, 2014.

  1. SpecialOne

    SpecialOne Registered Member

    Joined:
    Jan 12, 2011
    Messages:
    65
    Likes Received:
    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.
     
  2. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    5,905
    Likes Received:
    7,140
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
  3. blackcoffee7

    blackcoffee7 Junior Member

    Joined:
    Sep 27, 2014
    Messages:
    141
    Likes Received:
    46
    Home Page:
    If it isn't too large you can also use online tools like this one:
    text-compare [DOT] com
     
  4. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    712
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    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.
     
  5. SpecialOne

    SpecialOne Registered Member

    Joined:
    Jan 12, 2011
    Messages:
    65
    Likes Received:
    21
    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.
     
  6. theKpages

    theKpages Newbie

    Joined:
    Oct 24, 2014
    Messages:
    9
    Likes Received:
    2
    Occupation:
    Professional Fun-Haver
    Location:
    California
    Home Page:
    I use a tool called Diff-Merge...works great for me but I don't know about what you're doing?
     
  7. SpecialOne

    SpecialOne Registered Member

    Joined:
    Jan 12, 2011
    Messages:
    65
    Likes Received:
    21
  8. xeroxias

    xeroxias Junior Member

    Joined:
    Oct 20, 2013
    Messages:
    103
    Likes Received:
    13
    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!