HI,<br>Can any of you tell me how to write a unix shell script using AWK or general scripting<br>to append 3 files horizontally into a single file with two fields common in each file and the common fields doesn't repeat in the final file.<br><br>Example data::<br>file1<br><br>1234,abc,a12,zx,10<br>1235,acd,b35,dc,10<br>1456,cds,c25,fr,10<br>1290,cds,r45,fx,50<br><br><br>file2<br><br>1456,678,rrr,4679,10<br>1234,234,qqq,3456,10<br>1235,478,ddd,7890,10<br>1290,456,ttt,5867,50<br><br>file3<br><br>1290,ddd,345,50<br>1235,aaa,110,10<br>1234,ttt,100,10<br>1456,fff,234,10<br><br><br>The first and last fields for the three files are same but the order<br>they appear in each file might be different.<br>But it should grab the same first and last fields and write to final file<br>like below.<br><br>the final file should be like this.<br><br><br>1234,abc,a12,zx,234,qqq,3456,ttt,100,10<br>1235,acd,b35,dc,478,ddd,7890,aaa,110,10<br>1456,cds,c25,fr,678,rrr,4679,fff,234,10<br>1290,cds,r45,fx,456,ttt,5867,ddd,345,50<br><br>Any suggestions thanks<br>james.