How to check diff between two files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to check diff between two files
# 1  
Old 05-24-2010
How to check diff between two files

File 1 contains:
RECT 0 0 98 90
RECT 0 0 100 101


File 2 contains:
RECT 0 0 98.0 90.0
RECT 0 0 100 101

If I do, sdiff -s <file1> <file2>, it shows difference of first line.

But as the first line is algebrically equal, i want a command which shows no difference. i.e. it gives no difference when the numeral values are algebrically same.
# 2  
Old 05-24-2010
Quote:
Originally Posted by nehashine
File 1 contains:
RECT 0 0 98 90
RECT 0 0 100 101


File 2 contains:
RECT 0 0 98.0 90.0
RECT 0 0 100 101

If I do, sdiff -s <file1> <file2>, it shows difference of first line.

But as the first line is algebrically equal, i want a command which shows no difference. i.e. it gives no difference when the numeral values are algebrically same.

PLEASE stick to one thread...
HERE YOU ARE POSTING SIMILAR THREAD SECOND TIME.

https://www.unix.com/shell-programmin...#post302424071
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. UNIX for Dummies Questions & Answers

Diff for multiple files

Hello, I am trying to compare the contents of 4 directories using diff, where I want files that are present in dir1 but not in dir2, dir3 or dir4 I know this command can only compare 2 files, but I was hoping to find a way to get around this. I have this thought on my mind diff -q dir1... (4 Replies)
Discussion started by: Error404
4 Replies

3. Shell Programming and Scripting

Diff on 1gb files

Hey Guys, I have a scenario to compare two different files which are of size 1gb each. I need to get the uncommon lines. I planned to use sdiff command, which generally works perfect for me. But in this case am facing a error saying "diff: memory exhausted" Can anyone please explain this.... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

4. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

5. Shell Programming and Scripting

diff bw two files

Hi All, I have two files which look as below File1 serial="1" name="abc" type="employee" field="IT" serial="2" name="cde" type="intern" field="Marketing" serial="3" name="pqr" type="contractor" field="IT" serial="4" name="xyz" type="employee" field="Sales" File2 serial="1"... (3 Replies)
Discussion started by: grajp002
3 Replies

6. Shell Programming and Scripting

diff of files

Hi, I have 2 files.I want to check if file1 is contained in file2. A.txt: ----- AAA BBB B.txt: ------ CCC AAA BBB DDD I want to check if A.txt is contained in B.txt. Can it be done using SED ? (12 Replies)
Discussion started by: giri_luck
12 Replies

7. Shell Programming and Scripting

Diff b/w 2 files

Hi Masters, I have two files named file1 and file2. Both the files contains the same contents with some difference in comments,space.But no content change. I tried to find the diff between the two files to make sure that contents are same. For that i tried diff -ibw file1 file2 But... (1 Reply)
Discussion started by: ecearund
1 Replies

8. UNIX for Dummies Questions & Answers

Using diff on files in different directories

Hi, I want to be able to compare two different files in two different directories. I have a development server set up on one domain and a live server set up on another.....I need to be able to compare files on these two servers. Any ideas? (2 Replies)
Discussion started by: elduderino
2 Replies

9. Shell Programming and Scripting

Find duplicates from multuple files with 2 diff types of files

I need to compare 2 diff type of files and find out the duplicate after comparing each types of files: Type 1 file name is like: file1.abc (the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations). The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question