I have a text file which has data in the following format. I want to make one row for each value in the first column.
0-09935152 RC=3 CC=2 L=10-11
M=1
BNT=4
0-09935153 F=31 L=11
M=1
0-09935154 F=31 L=11
M=1
0-09935155 F=31 L=11
M=1
0-09935156 F=31 L=11
M=1
0-09935157 F=31 L=11
M=1
0-09935158 F=31 L=11
M=1
0-09935159 F=31 L=11
M=1
0-0993516 F=31 L=11
M=1
0-0993517 F=31 L=11
M=1
0-0993518 F=31 L=11
M=1
0-0993519 F=0 CC=2
M=1
I want to pull all corresponding values into one row. The expected output will be like
Code|M|F|CC|L|BNT|RC
0-09935152|1||2|10-11|4|3
0-09935153|1|31||11|||
I am trying to use awk to parse the text file. I am only able to segregate the columns but unable to proceed any further.
Any help is appreciated.