topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 8:03 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: compare text files  (Read 31186 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,823
    • View Profile
    • Donate to Member
compare text files
« on: November 09, 2007, 07:24 AM »
hello

I have two text files and I want to see which lines are duplicated in those files and which not

do you know any tool that is able to do that?

thanks

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #1 on: November 09, 2007, 07:28 AM »
There's several, including free and paid software. One of the favorite commercial offerings among fellow DonationCoder members seem to be Beyond Compare, which is a quite decent piece of software. The free WinMerge is also quite good.
- carpe noctem

iphigenie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,170
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #2 on: November 09, 2007, 07:31 AM »
I tend to use winmerge when i just need a quick comparison tool like that. http://winmerge.org/

If you need to do it often then there are many developent tools with that feature, but winmerge is open souce and should do the job


yksyks

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 476
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #3 on: November 09, 2007, 07:35 AM »

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
    • View Profile
    • Website
    • Donate to Member
Re: compare text files
« Reply #4 on: November 09, 2007, 08:59 AM »
I use UltraCompare Lite, which is built into UltraEdit.
Software For Metalworking
http://closetolerancesoftware.com

nontroppo

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 649
  • spinning top
    • View Profile
    • nontroppo.org
    • Donate to Member
Re: compare text files
« Reply #5 on: November 09, 2007, 09:10 AM »
Compare It! if you want to spend money (clearly best paid app IMO).

Winmerge if you want to do it for free.

Though I doubt most people care any more about INI files, I wrote an online INI diff tool ages ago (the issue being INI sections can move around without lines changing which most Diff tools fail to handle well):

http://nontroppo.org/ini/
FARR Wishes: Performance TweaksTask ControlAdaptive History
[url=http://opera.com/]

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #6 on: November 09, 2007, 07:19 PM »
Beyond compare

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #7 on: November 09, 2007, 08:47 PM »
it's a more complicated way, but you can get an editor that numbers the lines, and just open the two text files at once, and goto the two lines and compare them.
[Insert really cool signature here]

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #8 on: November 10, 2007, 12:15 AM »
Even better, you could open the first file and select the first line of text. Go to the 2nd file and search for that text; make a note of where it appears (or not) in the document. Repeat for each line of the first file, then swap files and start over.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #9 on: November 10, 2007, 04:59 AM »
Even better, you could open the first file and select the first line of text. Go to the 2nd file and search for that text; make a note of where it appears (or not) in the document. Repeat for each line of the first file, then swap files and start over.
...or you could use one of the compare apps, which are 1000x easier and better and faster :)
- carpe noctem

muntealb

  • Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 90
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #10 on: November 10, 2007, 06:54 AM »
The built-in compare module from PSPad (open source text editor) is in my opinion the best comparing tool for text files. It beats WinMerge from a usability point of view.

You open File 1 in PSPad, then go to Tools>Text Differences>text Diff with this file>Browse and choose File 2. The lines that are different in the two files will be colored.

Address : http://www.pspad.com/
« Last Edit: November 10, 2007, 06:56 AM by muntealb »

OGroeger

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 76
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #11 on: November 10, 2007, 07:06 AM »
As far as i know all comparison tools don't compare each line of one file which each line of a second file. They all define a kind of compare context in which they compare. The most simple example of such a context is that you compare only line 10 in one file with the lines 5 to line 15 in the other file. As a matter of fact the tools make this more clever, but dependant on how different the files of Kalos are, they might give him not the results he wants.

Btw. another comparison tool: ExamDiff

nontroppo

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 649
  • spinning top
    • View Profile
    • nontroppo.org
    • Donate to Member
Re: compare text files
« Reply #12 on: November 10, 2007, 07:24 AM »
The reason I originally chose Compare It! "compared" to Beyond Compare / Ultracompare is that I found its heuristics to handle moved sections better (as well as better within-line comparison). One can also use Regex pre-parsing or input plugins prior to matching to improve matching efficiency.
FARR Wishes: Performance TweaksTask ControlAdaptive History
[url=http://opera.com/]

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #13 on: November 10, 2007, 08:36 AM »
The reason I originally chose Compare It! "compared" to Beyond Compare / Ultracompare is that I found its heuristics to handle moved sections better (as well as better within-line comparison). One can also use Regex pre-parsing or input plugins prior to matching to improve matching efficiency.
That's nice to know :)
- carpe noctem

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #14 on: November 10, 2007, 08:56 AM »
Hmm, Compare It! is on sale today. 25% off for 24 hours. I see v4 is in alpha testing.

So far they haven't answered the ICQ message I sent them. I don't see any upgrade pricing on their site. Is it a lifetime license?
« Last Edit: November 10, 2007, 09:06 AM by tinjaw »

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #15 on: November 10, 2007, 09:44 AM »
Found this by digging through their FAQ:

The registration fee for a package including Compare It! and Synchronize It! is as low as US $29.

The registration fee includes:

Lifetime e-mail technical support
1 year of free upgrades
Discounts for future upgrades

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #16 on: November 10, 2007, 10:15 AM »
Hmm... I've loaded a demo of Compare It! - very nice nontroppo. I'm tempted to buy a licence - $21 today. But I've already got Beyond Compare 2, Folder Match (not even installed), and Ultra Compare Pro (lifetime licence) so am not sure that I can justify it! Love the GUI and the speed though. Much quicker than Beyond Compare  :Thmbsup:

So... any compelling reason for me to jump on this, other than to satisfy my unquenchable thirst for new and exciting software experiences  :huh: :-[ :o

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #17 on: November 10, 2007, 10:26 AM »
I just chatted with the developer. Transcript attached. (summary is that DC discount is still active.)

  Conversation with 28837946

*Conversation with 28837946 on 11/10/2007 8:52:23 AM:*
(08:52:50) *7825266:* Hello, I have a question about Compare It!.

------------------------------------------------------------------------

09:35
(09:38:13) *28837946:* Hello,
(09:38:24) *28837946:* Are you there yet?
09:55
(09:57:28) *7825266:* hello
(09:58:16) *7825266:* I don't see any upgrade pricing on your website.
(09:58:26) *7825266:* Is it a lifetime license?
10:00
(10:03:36) *7825266:* #2) does Compare It! come with the functionality
of Synchronise It!?
(10:04:15) *7825266:* My interpretation is that it does, and that you
can purchase the bundle if you wish to use Synchronize It on a second
computer.
(10:04:15) *28837946:* #2: no, features do not overlap in 2 programs
10:05
(10:05:18) *28837946:* if you purchase it now, you will have 1 year of
free upgrades. Your version you can use as long as you want.
(10:05:55) *28837946:* upgrade price is 40% of regular purchase
(10:06:14) *7825266:* I have multiple computers, but it is only me that
uses them. Am I allowed to install them on all my computers. For example
I have two desktops and a laptop.
(10:08:51) *28837946:* our license allow personal license to be used on
3 computers - typically home, work and laptop. If you need more - you
will have to purchase additional licenses. But if this is your home
computers, I think you can live with single personal license
10:10
(10:10:12) *7825266:* I am looking at Compare It! even though I have
Beyond Compare already because of something a forum buddy of mine posted...
(10:10:16) *7825266:* The reason I originally chose Compare It!
"compared" to Beyond Compare / Ultracompare is that I found its
heuristics to handle moved sections better (as well as better
within-line comparison). One can also use Regex pre-parsing or input
plugins prior to matching to improve matching efficiency.
(10:10:30) *7825266:* Can you please elaborate?
(10:12:09) *7825266:* I am busy with other projects today, and really
don't have time to demo Compare It. However, with the 24hour sale and
30-day money-back I may purchase and then try it out for a few weeks. Is
that acceptable?
(10:14:25) *28837946:* In fact you can even work with trial during these
weeks - trial is fully functional anyway. But you can purchase a
license, it's just fine, refund will not be a problem.
(10:14:59) *28837946:* When I last checked BC it wasn't able to find
moved sections, did it change?
10:15
(10:15:26) *28837946:* BC has regexp feature too, a bit more easier to
use then in ComapreIt
(10:16:18) *7825266:* I must confess that I haven't used BC on anything
but small files to date.
(10:16:31) *28837946:* If you need smarter aligning, you can check
latest beta of v4, it has automatch feature - when lines are aligned by
some "key" portion of string
(10:16:46) *7825266:* And I don't think I have had and large chunks moved.
(10:17:24) *28837946:* Anyway, if you will have a question on how to use
CompareIt more efficiently, you are always welcome.
(10:17:35) *7825266:* OK, thank you.
(10:17:49) *7825266:* May I post this conversation to the thread on
DonationCoder.com?
(10:18:01) *28837946:* sure, no problems.
(10:18:12) *7825266:* thank you
(10:18:18) *28837946:* I had some donationcoder discount, btw
(10:19:08) *7825266:* Is it still available? If not, would you like to
off it again?
(10:19:29) *28837946:* DCODER coupon - 50% off. yes, it should work
10:20
(10:20:20) *7825266:* Thank you. I will remind the other members of this
discount. That also means I can try the demo first and purchase with the
discount coupon later. Thank you again.
(10:20:26) *28837946:* Note that CompareIt alone does not cover BC
features - you need Synchronize It! too.
(10:20:40) *7825266:* Understood.

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #18 on: November 10, 2007, 10:52 AM »
Dang! Tinjaw - good work!

direnc

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #19 on: November 19, 2007, 04:15 PM »
The best diff app I have yet to see for text is the one that comes with Visual Slick Edit. I can't help but mention that Visual Slick Edit is one great editor for programmers.

iphigenie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,170
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #20 on: November 19, 2007, 04:30 PM »
I was about to post that I tend to use the diff tool that comes with slickedit.
I am stuck about 4 versions back on slickedit though, such a great tool but quite pricey

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: compare text files
« Reply #21 on: November 19, 2007, 06:38 PM »
I fail to see why people think SlickEdit is such a great editor :-s

It falls somewhere between IDE and Editor, I'd rather use a full-fledged IDE or a more lightweight editor. But perhaps I just fail to see it's glory :)
- carpe noctem

biosmonkey

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #22 on: November 20, 2007, 12:27 PM »
OK I'll chime in with my 2 cents.

I use Slickedit 2007 (v12) on a daily basis, and have used it since v5.  I also use Beyond Compare, especially in the past year while I have been working on some high-profile web applications.

Slickedit by itself is not a stellar IDE, because it attempts to be generic and as such cannot offer all of the bells and whistles of a dedicated IDE.  (Take Flex Builder for example).  But its real power comes in code manipulation and the macros you can write with its built in C-like language.  I have written macros you wouldn't believe, as well as extending the editor itself with my own functions, forms, dialogs, and text filters (most of the editor's function is exposed in the included macro source).  So I use Slickedit as a pure text editor in conjunction with whatever IDE I am working with (which is why detection of file changes is essential!).  For quick coding, or when I need the code hinting, I will use the IDE, but when I want to really move text around, I go to SE.

But I will disagree with the other person regarding Diffzilla (slickedit's file diff tool).  It is just too simple and, from my experience, awkward when handling UTF8 files.  I gave up on it a long time ago when I discovered BC.

Beyond Compare has been an ABSOLUTE NECESSITY for my work ... I can't tell you how vital it has been when synchronizing hundreds of multilanguage utf8 files in several different code bases.

I cannot speak for Compare It as I have not tried it.  But I will mention that some of the features it offers that BC currently does not have are possibly coming in BC3 (syntax highlighting, inline editing etc).

Tinman57

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,702
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #23 on: November 20, 2007, 08:29 PM »
  I have two freebies that I use for that.  CSDiff and VData.  Sorry, don't have the links.  Google it.   ;)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: compare text files
« Reply #24 on: November 20, 2007, 09:07 PM »
Btw. another comparison tool: ExamDiff

or its [url=http://www.prestosoft.com/edp_examdiff.asp]freeware version..

edscreen.png