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: Mon Sep 25 02:02:51 CDT 2023