Thread: Diff files

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    68
    Rep Power
    2

    Diff files


    hey guys, does anyone knows how to compare 2 text files and identify what has been added and what has been removed from the one file to the other one? i dont want to use diff because diff compares line by line only and if i add a new line it will print on screen everything.


    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,875
    Rep Power
    1225
    I'm not sure I understand your objection to using the diff utility, but it sounds like you're not passing it the proper option parameters.

    Have you tried creating a "unified" diff?

    On the Perl side, if you want to compare the files and only receive a boolean answer, then you should look at the File::Compare module.

    If you want to get an actual diif which can be applied via the patch utility, then look at the Text::Diff module.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    0
    Where i can find to download this program?
    Thanks!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,875
    Rep Power
    1225
    Originally Posted by Ion83
    Where i can find to download this program?
    Thanks!
    I assume you're referring to the Perl modules I suggested. Click on the links I provided in my post to find the documentation for each module and the download link for the tar file of the module is on the upper right of the page.

IMN logo majestic logo threadwatch logo seochat tools logo