arrange in-ordered comma separated data into desired header/column wise in unix

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

arrange in-ordered comma separated data into desired header/column wise in unix

praveen
hi, can you pls help me.
I have a text file which consists lot of comma separated lines.
I want it to arrange in a desired header wise data.

input:
--------
1st) BILL_ID=141,SCP_ID=22055092,CDR_TYP=3,SEQ_NUM=2116036986,,,,,,
2nd)BILL_ID=161,SEQ_NUM=0,CDR_TYP=5,SCP_ID=225338773,WALL_TYP=21,NET=HOME_MO,CRENUM=401d413406b20d,,,,,,
3rd)BILL_ID=142,AC_ID=47941008,REF_ID=48701835,SCP_ID=22055713,SEQ_NUM=1879496145,CDR_TYP=5,,,,,,

desired output
----------------
BILL_ID,SCP_ID,SEQ_NUM,CDR_TYP,WALL_TYP,NET,CRENUM,AC_ID,REF_ID
141,22055092,2116036986,3,,,,
161,225338773,0,5,21,HOME_MO,401d413406b20d,,
142,22055713,1879496145,5,,,,47941008,48701835
Reply | Threaded
Open this post in threaded view
|

Re: arrange in-ordered comma separated data into desired header/column wise in unix

Guru
Administrator
  Can you please show us what have you tried?