Code:
cat a b >c
nawk '{
if (a=="")
a=sprintf("%s",$1)
else
{
if (index(a,$1)==0)
a=sprintf("%s,%s",a,$1)
else
{
a=sprintf("%s%s",substr(a,1,index(a,$1)-1),substr(a,index(a,$1)+2,length(a)-index(a,$1)-1))
}
}
if (b=="")
b=sprintf("%s",$2)
else
{
if (index(b,$2)==0)
b=sprintf("%s,%s",b,$2)
else
b=sprintf("%s%s",substr(b,1,index(b,$2)-1),substr(b,index(b,$2)+2,length(b)-index(b,$2)-1))
}
if (c=="")
c=sprintf("%s",$3)
else
{
if (index(c,$3)==0)
c=sprintf("%s,%s",c,$3)
else
c=sprintf("%s%s",substr(c,1,index(c,$3)-1),substr(c,index(c,$3)+2,length(c)-index(c,$3)-1))
}
}
END{
split(a,arr,",")
split(b,brr,",")
split(c,crr,",")
for (i=1;i<=10;i++)
printf("%5s %5s %5s\n",arr[i],brr[i],crr[i])
}' c
rm c