I do have an input text file of the following format with 1000's of lines
input file:
3386(11:11,Ani:0,Bri:1,ch:1,Jwe:0,Jor:0,LP:0,Lo:0,NS:1,al:1,bo:0,boy:0,bru:0,sh:0,cor:1,dum:0,ery:0,mac:0,mic:0)
3387(11:11,Ani:1,Bri:0,ch:1,Jwe:2,Jor:0,LP:0,Lo:0,NS:3,al:1,bo:0,boy:0,bru:0,sh:0,cor:4,dum:0,ery:1,mac:0,mic:0)
386(11:11,Ani:1,Bri:1,ch:1,Jwe:4,Jor:0,LP:0,Lo:3,NS:1,al:1,bo:7,boy:0,bru:9,sh:0,cor:1,dum:0,ery:0,mac:0,mic:0)
.....
.......
1000's lines
Would like to transform this data into a tab delimiited file of the following format:
Basically the first number on each file will be a column and the rows (horizontal) content on the input file will be the row. The number after each of the : will be value in the matrix
Desired output
3386 3387 386
Ani 0 1 1
Bri 1 0 1
ch 1 1 1
Jwe 0 2 4
Jor 0 0 0
LP 0 0 0
Lo 0 0 3
NS 1 3 1
al 1 1 1
bo 0 0 7
boy 0 0 0
bru 0 0 9
sh 0 0 0
cor 1 4 1
dum 0 0 0
ery 0 1 0
mac 0 0 0
mic 0 0 0
It would be great if I could get some help in awk or another language to do this data transformation