file merge based on common columns

I have two files
1.txt

34, ABC, 7, 8, 0.9
35, CDE, 6.5, -2, 0.01

2.txt

34, ABC, 9, 6, -1.9
35, CDE, 8.5, -2.3, 5.01

So in both files common columns are 1 and 2

so final o/p should look like

34, ABC, 7, 8, 0.9, 9, 6, -1.9
35, CDE, 6.5, -2, 0.01, 8.5, -2.3, 5.01

I tried using joins , but it's omehow repeating itself.
Can anyone suggets better way to do this.

Try this:

sed 's/,/ /' 1.txt>tmp1; sed 's/,/ /' 2.txt|join -t, tmp1 -|sed 's/ /,/'; rm tmp1

Hi,

Try this one,

awk 'BEGIN{FS=",";OFS="";}FNR==NR{a[$1","$2]$0;next;}{t=$1","$2;if(a[t]){gsub(t,"");print a[t],$0;}}' 1.txt  2.txt

Cheers,
Ranga:-)

hi Ranga,

All i did ,

awk 'BEGIN{FS=",";OFS="";}FNR==NR{a[$1","$2","$3","$4","$5","$6]$0;next;}{t=$1","$2","$3","$4","$5","$6;if(a[t]){gsub(t,"");print a[t],$0;}}'

as in my actual file there are 6 columns, which are matching and based on that I need to join the files. but somehow it's not liking the way it's done.

but which is exactly same as my initial question.