Home » Infrastructure » Unix » File Comparison help
File Comparison help [message #189796] Sun, 27 August 2006 19:19 Go to next message
coolguy01
Messages: 64
Registered: August 2006
Member
I have a file named file1 which contains numbers in sequence like...
1
2
3
7
8
Then i have file File 2 that contains
4
5
........so i need to compare both files so that i can find out the missing entry in the sequence is 6.......
I guess i cant use diff command or comm command for this , if i can how can i do it plz let me know guys.
Re: File Comparison help [message #189800 is a reply to message #189796] Sun, 27 August 2006 20:57 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
what does this question have to do with Oracle?
Re: File Comparison help [message #189935 is a reply to message #189800] Mon, 28 August 2006 11:44 Go to previous messageGo to next message
coolguy01
Messages: 64
Registered: August 2006
Member
The files i am talking about are flat files which contain the data which need to be inserted into the oracle database later........
Re: File Comparison help [message #189951 is a reply to message #189935] Mon, 28 August 2006 13:00 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
You can query for gaps in SQL (so you could load your data into a staging table to look for gaps). You could probably also sort the file on the column of interest and then use shell arithmetic to subtract current from previous. Whatever solution you come up with - make sure it's tested well to handle duplicates, boundary contitions, 1 row files etc.

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:3225867788098
Re: File Comparison help [message #189970 is a reply to message #189951] Mon, 28 August 2006 15:17 Go to previous messageGo to next message
coolguy01
Messages: 64
Registered: August 2006
Member
Thanks a lot andew.................
Re: File Comparison help [message #190750 is a reply to message #189796] Fri, 01 September 2006 02:09 Go to previous message
raom
Messages: 22
Registered: January 2006
Location: india
Junior Member
cat f1 f2 | sort -n
Previous Topic: File System Space
Next Topic: UNIX Shell scripting
Goto Forum:
  


Current Time: Thu Apr 18 21:04:25 CDT 2024