Home » Infrastructure » Unix » comparing two .dat files
comparing two .dat files [message #165588] Fri, 31 March 2006 00:23 Go to next message
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 #165614 is a reply to message #165588] Fri, 31 March 2006 01:23 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

Why don't you try Unix's diff command??

look here

http://www.computerhope.com/unix/udiff.htm
Re: comparing two .dat files [message #165897 is a reply to message #165588] Mon, 03 April 2006 04:25 Go to previous messageGo to next message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
Do a 'man' on diff (man diff). That should show you how it works.
Neil.
Re: comparing two .dat files [message #166087 is a reply to message #165897] Tue, 04 April 2006 08:12 Go to previous messageGo to next message
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 Go to previous message
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.
Previous Topic: Undo tablespace can't shrink and time in v$undostat is wronge
Next Topic: SFTP UNIX script
Goto Forum:
  


Current Time: Fri Nov 22 10:19:51 CST 2024