468,734 Members | 2,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,734 developers. It's quick & easy.

Comparing text files

I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed VC++.NET
Managed application, this is as good a place as any to get the ball rolling.
Where is the appropriate place to ask the following question:

Is there any way to compare two text files to see if they are identical?
There use to be an easy DOS command many years back, but not sure how to do
this in Windows XP!

[==Peteroid==]
Nov 17 '05 #1
5 1306
Peteroid wrote:
I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed
VC++.NET Managed application, this is as good a place as any to get
the ball rolling. Where is the appropriate place to ask the following
question:
Is there any way to compare two text files to see if they are
identical? There use to be an easy DOS command many years back, but
not sure how to do this in Windows XP!


fc.exe still exists - you could always shell out to fc to compare the files
for you (use ShellExecute or a member of the *exec*() family of fine
functions in the C runtime library, or CreateProcess from the Win32 API if
you're a glutton for punishment.

You can also read the contents of the files into blocks of memory and
compare them yourself. If the files might be large, you'd want to write
code that's a bit more general and compares the files in chunks rather than
all at once so you don't have to allocate large blocks of memory.

-cd
Nov 17 '05 #2

You may use some software like the Compare Suite from the AKS Labs.

--
JonnieO
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 17 '05 #3
Peteroid wrote:
Is there any way to compare two text files to see if they are identical?
There use to be an easy DOS command many years back, but not sure how to do
this in Windows XP!


If you're looking for an application there's open source project
WinMerge <http://www.winmerge.org/> that is doing an excellent job of
not only comparing files and directories, but merging them as well.
Nov 17 '05 #4
You may want to check our Compare It! tool from http://www.grigsoft.com/.

Igor Green
http://www.grigsoft.com/
Compare It! + Synchronize It! - files and folders comparison never was easier!
Nov 17 '05 #5
sam


"Peteroid" wrote:
I realize this might not be the correct newsgroup, but since I have a
general question I need answering in the context of doing a managed VC++.NET
Managed application, this is as good a place as any to get the ball rolling.
Where is the appropriate place to ask the following question:

Is there any way to compare two text files to see if they are identical?
There use to be an easy DOS command many years back, but not sure how to do
this in Windows XP!

[==Peteroid==]

<sam> you can use Windiff tool, which is available if you install microsoft
visual studio .
<sam>

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Wescotte | last post: by
6 posts views Thread by Holger Kasten | last post: by
3 posts views Thread by =?Utf-8?B?UG9vamE=?= | last post: by
2 posts views Thread by Smithers | last post: by
9 posts views Thread by Shriphani | last post: by
3 posts views Thread by erbrose | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.