LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Compare two cvs files.... (https://www.linuxquestions.org/questions/linux-general-1/compare-two-cvs-files-245188/)

trey85stang 10-20-2004 01:45 PM

Compare two cvs files....
 
How can I compare two cvs files line by line only and put the non-matching lines into a new file??

Broken down questions,

I have two CVS files, 1 and 2 respectivly, each has lets say two fields... Name and Badge

I need to compare the differences on file 2 with file 1. Or easier said... I need to know what is on file 2 that is not on file one and move that information two file 3?

I need this to be done line by line, not chacter per charcter....


I have looked at "man diff" and I cannot figure out if this command will do this or not.. It does not seem to output like i needed..

I have looked at comm, of course the man page is kinda small on this one.. so I doubt this will do what I need. and I have looked at all commands related to these two....

Is there anything out there??? :(


Also I am not sure if this is the correct forum to ask this question... as it applies to unix or linux.

Thanks
Trey

trey85stang 10-21-2004 10:51 AM

ttt, any ideas?

hw-tph 10-22-2004 12:25 PM

To do it directly through CVS you would use the cvs diff command. For example, to view the differences between the 1.0 revision and 1.1 revision of the file helloworld.c you would use cvs diff -r1.0 -r1.1 helloworld.diff. You could also use date tags instead of revision numbers if you don't know or don't care about the version numbering.

When using normal diff you can use the -uN switches to use the unified format (which is pretty human-readable): diff -uN file1.c file2.c > differences.diff
You can then use vim to view the resulting diff file in pretty colorization.



Håkan

trey85stang 10-23-2004 08:05 PM

Quote:

Originally posted by hw-tph
To do it directly through CVS you would use the cvs diff command. For example, to view the differences between the 1.0 revision and 1.1 revision of the file helloworld.c you would use cvs diff -r1.0 -r1.1 helloworld.diff. You could also use date tags instead of revision numbers if you don't know or don't care about the version numbering.

When using normal diff you can use the -uN switches to use the unified format (which is pretty human-readable): diff -uN file1.c file2.c > differences.diff
You can then use vim to view the resulting diff file in pretty colorization.



Håkan

That seems to do what I am looking for!

Thanks
Trey


All times are GMT -5. The time now is 04:48 PM.