::::::::::::::
table1
::::::::::::::
2,xx,yy,zz
1,x,y,z
3,xxx,yyy,zzz
::::::::::::::
table2
::::::::::::::
1,a,b,c,d
3,aaa,bbb,ccc,ddd
2,aa,bb,cc,dd
3,aaa3,bb3,cc3,dd3
awk -F',' 'NR==FNR {a[$1]=($0);next} a[$1] {$1=a[$1]} {print $0}' OFS=','
table1 table2
1,x,y,z,a,b,c,d
3,xxx,yyy,zzz,aaa,bbb,ccc,ddd
2,xx,yy,zz,aa,bb,cc,dd
3,xxx,yyy,zzz,aaa3,bb3,cc3,dd3
::::::::::::::
table1
::::::::::::::
2,xx,yy
1,x,y,z
3,xxx,yyy,zzz
::::::::::::::
table2
::::::::::::::
1,a,b,c,d
3,aaa,bbb,ccc,ddd
2,aa,bb,cc,dd
3,aaa3,bb3,cc3,dd3
awk -F',' 'NR==FNR {a[$1]=($1","$2","$3","$4);next} a[$1] {$1=a[$1]}
{print $0}' OFS=',' table1 table2
1,x,y,z,a,b,c,d
3,xxx,yyy,zzz,aaa,bbb,ccc,ddd
2,xx,yy,,aa,bb,cc,dd
3,xxx,yyy,zzz,aaa3,bb3,cc3,dd3
I am an IOT enthusiast with more than 20 years of experience in the IT sector. Specializing in telecom service's; follow me for some very innovative and best in class IOT products as I unfold my knowledge and passion for the subject.
Just me, myself and I, exploring the universe of uknownment. I have a heart of love and interests in technology, IOT and travel . And I want to share my world with you .