I have a big file with many brackets () in it from which I need to parse number characters and numbers. Below is an example of my file
14 (((A__0:0.02,B__1:0.3)0:0.04,C__0:0.025)2:0.01),(D__0:0.00978,E__2:0.01031)1:0.00362;
15 (((A__3:0.02,B__1:0.3)2:0.04,C__1:0.025)2:0.01),(D__0:0.00978,E__2:0.01031)1:0.00362;
20 (((A__1:0.02,B__1:0.3)0:0.04,C__2:0.025)1:0.01),(D__4:0.00978,E__2:0.01031)2:0.00362;
..
..
...
...
I want to parse out the values and characters starting from each of the inner brackets and out put in a line in such a way that the numerical value just outside an inner bracket comes first followed by the number associated with the character (for A__0 A and 0). An example of the desired output is given below
14
0 A 0 B 1
2 C 0
1 D 0 E 2
15
2 A 3 B 1
2 C 2
1 D 0 E 2
20
0 A 1 B 1
1 C 2
2 D 4 E 2
Please let me know the best way to parse this using awk or sed.