472,146 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Compare files

SP
Hi All,

I need to compare two files line by line and copy the differing lines to a
new files. I.e. Compare file1 and file2 line by line. Copy only differing
lines to file3.

I tried a couple of ways with filestreams. But did not achieve it correctly.

Any help would be greatly appreciated...
Nov 16 '05 #1
2 2971
What ways have you tried?

You can wrap a FileStream with a StreamReader and read one line at a time,
then compare them.

"SP" <EA*@dhmh.com> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
Hi All,

I need to compare two files line by line and copy the differing lines to a
new files. I.e. Compare file1 and file2 line by line. Copy only differing
lines to file3.

I tried a couple of ways with filestreams. But did not achieve it correctly.
Any help would be greatly appreciated...

Nov 16 '05 #2
SP
I was trying by converting it into bytes. Now I am able to compare with out
a problem.

Thanks,
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OO**************@TK2MSFTNGP12.phx.gbl...
What ways have you tried?

You can wrap a FileStream with a StreamReader and read one line at a time,
then compare them.

"SP" <EA*@dhmh.com> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
Hi All,

I need to compare two files line by line and copy the differing lines to a new files. I.e. Compare file1 and file2 line by line. Copy only differing lines to file3.

I tried a couple of ways with filestreams. But did not achieve it

correctly.

Any help would be greatly appreciated...


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nicolas Fleury | last post: by
8 posts views Thread by Vincent | last post: by
5 posts views Thread by drabee | last post: by
6 posts views Thread by yinglcs | last post: by
1 post views Thread by =?Utf-8?B?RGFuaWVsIERpIFZpdGE=?= | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.