Transpose and split a record using awk -


i've record this

35366302,shenzhen basicom h838 35180800,adcon telemetry a733 addwave gsm 35347200 35557601,act''l ewon 45005801 45006201 45006202,aeg 9020/aeg ht901 

and want result this.

35366302,shenzhen basicom h838 35180800,adcon telemetry a733 addwave gsm 35347200,act''l ewon 35557601,act''l ewon 45005801,aeg 9020/aeg ht901 45006201,aeg 9020/aeg ht901 45006202,aeg 9020/aeg ht901 

how use proper awk command case ?

a complete records such below.

45006401 45006402 45006405 45006501 45006502 45006701 45006702 45006705 45006801 45006802 45006805,39,aeg ht911,alqn5h,-9,aeg_ht911,n,n/a,n/a,no,no,n,proprietary,proprietary,n/a,n/a,gsm 900,n,y,n,n,u,u,no,u,n,n,n,n,0,n,0,n,n,n,n,no,-9,-9,-9,-9,n/a,basic phone,n/a,n/a,-9,-9,-9,-9,n/a,n,n/a,n,n,n/a,n/a,n,n,no,0,n,n,n,n,n,n,n,n,n,n,n,n/a,-9,-9,-9,-9,u,-9,n/a,n/a,u,u,u,u,u,u,u,n/a,n,u,n,n,n,y,n,n,n,n,n,u,n,n,n,n,u,u,-9,n,n,u,n,n,n,n,n,n,1,1,0,0,-9,-9,n/a,n/a,n/a,n/a,-9,-9,n/a,n/a,-9,-9,n/a,n/a,0,n/a,-9,-9,n,n/a,u,-9,0,n/a,n/a,n/a,n/a,-9,n/a,-9,0,no,n/a,-9,n/a,-9,no,-9,no,n/a,0,n/a,n/a,-9,-9,n/a,0,n/a,n/a,-9,-9,n/a,-9,n/a,n/a,no,-9,n/a,-9,n/a,n/a,n,-9,-9,n/a,0,0,n/a,n/a,n/a,u,0,-9,n/a,n/a,no,n/a,0,-9,no,0,n/a,n/a,n/a,0,-9,n/a,no,n/a,n/a,n/a,-9,n/a,u,u,n/a,-9,n,n,n,n, 

another awk :

awk -f, '{split($1, a, " "); for(i=1; i<=length(a); i++){$1=a[i]; print}}' ofs=, file 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -