|
Remove all instances of duplicate records from the file
Hi experts,
I am new to scripting. I have a requirement as below.
File1:
A|123|NAME1
A|123|NAME2
B|123|NAME3
File2:
C|123|NAME4
C|123|NAME5
D|123|NAME6
1) I have 2 merge both the files.
2) need to do a sort ( key fields are first and second field)
3) remove all the instances of duplicate records from the merged file and write write all these duplicate instances into one file.
4) rest of the records which are unique in the original source files, needs to be written into another file
outfiles:
file3:
A|123|NAME1
A|123|NAME2
C|123|NAME4
C|123|NAME5
File4:
B|123|NAME3
D|123|NAME6
Please help me with the solution as I am in real urgent. Appreciate your help.
Thank you
|