comparing two .dat files [message #165588] |
Fri, 31 March 2006 00:23 |
kodali
Messages: 24 Registered: February 2006 Location: PUNE
|
Junior Member |
|
|
Hi,
compare two .dat files if there is any difference in both files difference will be send to the new file.
can anybody having shell scripting please send me it is urgent for my related project
Thanks in advance
|
|
|
|
|
Re: comparing two .dat files [message #166087 is a reply to message #165897] |
Tue, 04 April 2006 08:12 |
kodali
Messages: 24 Registered: February 2006 Location: PUNE
|
Junior Member |
|
|
hi,
how can we write shell programming to compare two .dat files and difference file will be send it to another file using diff command. how can we do that
here in first file
10Ç20060323Ç01
01ÇbabuÇ3000
01ÇbaluÇ4000
99Ç04
and second file
10Ç20060324Ç01
01ÇbabuÇ3000
01ÇbaluÇ4000
01ÇkumarÇ8000
99Ç05
and i want for both file difference using unix
i don't know how to write shell programming for this
|
|
|
Re: comparing two .dat files [message #167113 is a reply to message #166087] |
Tue, 11 April 2006 07:21 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
[user2]$ cat > file1
10Ç20060323Ç01
01ÇbabuÇ3000
01ÇbaluÇ4000
99Ç04
[user2]$ cat > file2
10Ç20060324Ç01
01ÇbabuÇ3000
01ÇbaluÇ4000
01ÇkumarÇ8000
99Ç05
[user2]$ diff file1 file2 > out_file3
[user2]$ cat out_file3
1c1
< 10Ç20060323Ç01
---
> 10Ç20060324Ç01
4c4,5
< 99Ç04
---
> 01ÇkumarÇ8000
> 99Ç05
And for more options of diff command . write "man diff" on the prompt.
|
|
|