469,364 Members | 2,398 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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 2894
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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.