By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,899 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,899 IT Pros & Developers. It's quick & easy.

Compare files

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.