Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix file comparison

Status
Not open for further replies.

sabate

Technical User
May 20, 2004
3
US
I'm doing a code review that compares one directory to another. I keep getting differences and when I go in to Clearcase vtree and do a compare betweew the two it shows the entire file as being differnt. We first thought it was a spacing issue so ran a (dircmp -w firstfile secondfile ) we got a whole screen of information. Nothing that is helping. I went through line for line and can't find a difference. This is why I think it's a spacing issue all the words are coming up different....yet they are are all the same...I'm about to blow over this.....
 
Have you tried cmp to see at which character the difference starts ?
You may also consider to compare with diff the hexadimal dumps (man od).

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, I've tried both and keep getting the entire file line by line... I'm now copying the two files into word and doing a word count....looks like the counts are off so I guess I'm going to conquer this the old fashion way....line by line with a highlighter...unless you know of something I'm doing wrong. I have 35 files I will have to go through : (

I did...
diff -w par_cc/ddl/P_trls_b.sql par_up403/ddl/P_trls_b.sql

THEN THIS...

comm -12 par_cc/ddl/P_trls_b.sql par_up403/ddl/P_trls_b.sql
THEN THIS...

sdiff -o output par_cc/ddl/P_trls_b.sql par_up403/ddl/P_trls_b.sql

AND EVEN THIS...

sdiff -s par_cc/ddl/P_trls_b.sql par_up403/ddl/P_trls_b.sql

Nothing seems to work......
 
Have you checked the file size ?
What is the output of the cmp command ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
What about using vi to edit the file then use the command ":set list"

This will show control characters in the files (normally the problem is spaces being replaced by tabs or visa-versa)

Have two terminal windows side by side for the files.

hth

I love deadlines. I like the whooshing sound they make as they fly by - Douglas Adams
 
Thanks everyone for your great advise unfortunately it wasn't the spaces or tabs it seems to be the date/time stamp they are different ...so if anyone know how I can perform a diffcmp and get it to ignore the time stamp, that would be great [sunshine]
 
I can't.
But if you want to count words next time, use wc.

>wc file
c w l

c:characters
w:words
l:lines

... copy into word... ts, ts, ts, ...

On linux/kde you might use kdiff, which is much better viewable than diff.

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top