[REQ] Text Differ

  • Thread starter Thread starter Mario Alvares
  • Start date Start date
M

Mario Alvares

Hi,

Anyone know of a program that compares 2 text files and displays only
the *matching* lines? Most text diff programs do the opposite, they
have an option to display only the different lines. However, I need to
know what lines are the same in both files.

Any help appreciated.

Thanks,
Mario
 
Hi,

Anyone know of a program that compares 2 text files and displays only
the *matching* lines? Most text diff programs do the opposite, they
have an option to display only the different lines. However, I need to
know what lines are the same in both files.

Depends,

What do you want to do with that information? If you just want to
see (save to file) the duplicate lines, it's trivial to write. If
you want a program to allow you to *use* that information,
well then ...
 
Dewey said:
Depends,

What do you want to do with that information? If you just want to
see (save to file) the duplicate lines, it's trivial to write. If
you want a program to allow you to *use* that information,
well then ...

Hi Dewey,

I just want to see the same lines in both files, so that I can copy /
paste those lines into a text file OR have the program save the same
lines into a file for me.

Do you happen to know of a program that does this?
 
Anyone know of a program that compares 2 text files and displays only
the *matching* lines? Most text diff programs do the opposite, they
have an option to display only the different lines. However, I need to
know what lines are the same in both files.

Microsoft WinDiff does what you want. Chances are that you have it on
disk or on your Windows installation CD. Else you can download it as
part of several free packages from MS. You have to look for yourself
which package fits your needs best.

Set <Options> only to <Show identical lines>. If you want to extract the
results, you say <Edit composite file> and have your identical lines
extracted.

BeAr
 
B. R. 'BeAr' Ederson said:
Microsoft WinDiff does what you want. Chances are that you have it on
disk or on your Windows installation CD. Else you can download it as
part of several free packages from MS. You have to look for yourself
which package fits your needs best.

Set <Options> only to <Show identical lines>. If you want to extract the
results, you say <Edit composite file> and have your identical lines
extracted.

I have version 5.0.1644.1 of WinDiff on my machine, but I don't see a
"Show Identical lines" option anywhere. Maybe you have a different
(newer ?) version that has this option ?
 
I have version 5.0.1644.1 of WinDiff on my machine, but I don't see a
"Show Identical lines" option anywhere. Maybe you have a different
(newer ?) version that has this option ?

Version 5.0.2195.5080 here.

BeAr
 
Mario said:
I have version 5.0.1644.1 of WinDiff on my machine, but I don't see a
"Show Identical lines" option anywhere. Maybe you have a different
(newer ?) version that has this option ?

To answer my own question, I downloaded a newer version of WinDiff from
here :

http://www.grigsoft.com/download-windiff.htm

and it does indeed have a "Show Identical Lines" option that does
exactly what I need.

Thanks to all who replied, especially BeAr.
 
Thanks to all who replied, especially BeAr.

Glad I could help you. But let me add another suggestion. - All along I
had the feeling to miss an important fact. And finally got hold of the
cause: You should have used a *nix based diff utility, like the one
you'll find here:

http://unxutils.sourceforge.net

With the simple command line:

diff.exe --old-line-format= --new-line-format= file1 file2

you should get a perfect output. ;-)

BeAr
 
I have version 5.0.1644.1 of WinDiff on my machine, but I don't see a
"Show Identical lines" option anywhere. Maybe you have a different
(newer ?) version that has this option ?
From windiff.hlp:

Compare files… leads to a file open dialog for each of two files to be
compared

Compare directories…leads to dialog to allow entry of two directory
names for comparison

Abort will be greyed unless an operation is in progress. Then allows
that operation to be terminated before completion. When this is not
greyed, there is also an Abort button at the top right of the window
which has the same function.

Save File List allows the list of files which are (the same, different,
only in left or only in right) to be saved. In addition, a checksum
for each file can be saved.

Copy Files… leads to a dialog allowing you to write the files to a disk.
This can be useful if you are trying to synchronise two directories.

Print prints the current view (either outline or expanded)
 
"Mario Alvares" <[email protected]> wrote:
Anyone know of a program that compares 2 text files and displays only
the *matching* lines? Most text diff programs do the opposite, they
have an option to display only the different lines. However, I need to
know what lines are the same in both files.


This 'might' work. It has a d switch (/d) that only shows file
differences, so without the switch it stands to reason that it will
not display differences.

http://www.prestosoft.com/ps.asp?page=edp_examdiff



And it's been awhile since this site has been mentioned... two thumbs
up!

http://freeware.stalkingsheep.co.uk/
 
REM said:
This 'might' work. It has a d switch (/d) that only shows file
differences, so without the switch it stands to reason that it will
not display differences.

http://www.prestosoft.com/ps.asp?page=edp_examdiff

Unfortunately, the '/d' switch in Exam Diff doesn't work that way.
Without the switch, *all* lines in both files are displayed, and the
changed / deleted / added lines are highlighted.

Thanks, anyway.
 
On Sun, 06 Feb 2005 02:47:03 +0530, Mario Alvares

To answer my own question, I downloaded a newer version of WinDiff from
here :

< snip >

A trip here might help too ;

http://www.codeguru.com/Cpp/misc/samples/article.php/c1499


Regards, John.

--
****************************************************
,-._|\ (A.C.F FAQ) http://clients.net2000.com.au/~johnf/faq.html
/ Oz \ John Fitzsimons - Melbourne, Australia.
\_,--.x/ http://www.vicnet.net.au/~johnf/welcome.htm
v http://clients.net2000.com.au/~johnf/
 
Back
Top