Hello guys I am new to awk programming. I need the below required script which can perform the following.
I have a file containing below data.
SNA NoCRD = 131
SNA OBarr = 3
SNC NoCRD = 76
SNC OBarr = 1
SND NoCRD = 155
SND OBarr = 5
SNE NoCRD = 100
SNE OBarr = 1
SNF NoCRD = 131
SNF OBarr = 5
SNG NoCRD = 123
SNG OBarr = 2
SNH NoCRD = 129
SNI NoCRD = 121
SNI OBarr = 3
SNJ NoCRD = 124
SNJ OBarr = 4
SNK NoCRD = 118
SNK OBarr = 3
SNM UnK = 5
SNM NoCRD = 391
SNM OBarr = 3
SNN NoCRD = 101
SNN OBarr = 7.
I want to replace the codes with a number but with a format like,
If it is SNA then just print only a digit like 1. since in my case I have SNA for 2 times with two more values, so I want to print only a one line above those 2 values but not with SNA infront of each line. similarly i want to do for the rest of the file. and then dump it in a new file.
Kindly help me in this regards. I will be very grateful.
Thanks in Advance