Friends,
os: redhat enterprise linux/SCO UNIX5.0
I have two files and I would like to merge on given key value.
Quote:
File1
111 : abcd : 75000 : newdelhi : jacob
222 : cdef : 50000 : mumbai : smith
334 : defg : 80000 : chennai : murphy
445 : dfgh : 80000 : kolkota : richard
555 : fhtk : 80000 : mumbai : gary
666 : hktk : 55000 : newdelhi : viva
file2
peter, 70000, ahmedabad, 777
jacob, 75000, newdelhi, 112
serly, 90000, nagpur, 888
rihcard, 80000, kolkata, 450
turig, 90000, newdelhi, 765
Here you can observe that the file1 is delimited with ":" and file2 with ","
and the out put I want is :
output on name base:
jacob newdelhi 75000 112 111
richard kolkota 80000 445 450
output on city base:
newdelhi 111 112 75000 jacob
kolkota 445 450 60000 richard
|
Now I have tried with join commd but it does not supporte multiple delimiters.
and if records length is not fixed.
join -a1 5 -a2 1 -t[;,] -o file1 file2 > outname
Can any one give details if join supports strings base join uitlity.
Thanks in advance friends.