In my file file# there is text RXOCF, in the field accross from this text, there is a two digit number. Like 60 or 62. I need to grab that number and find the text TG_TEI in the first pre_build_b# file and replace it, but keep using the end number to the output file pre_build_c#
Here is what I have so far that create the new file, but it grabs the whole original file# file, I just need that text next to RXOCF, the example is below:
The file file#:
<RXMOP:MO=RXOCF-11;
RADIO X-CEIVER ADMINISTRATION
MANAGED OBJECT DATA
MO TEI SWVERREPL SWVERACT SIG
RXOCF-11 62 DEFAULT B0531R0702 CONC
BSSWANTED NEGSTATUS
90 SUCCESSFUL
My Script:
/RXOCF/ {
fn = FILENAME
sub(/^[^0-9]*/,"",fn)
fn1 = "file" fn
fn2 = "pre_build_c" fn
num = $2
while ((getline < fn1 ) > 0) {
gsub(/TG_TEI/,num)
print > fn2
}
close(fn1)
close(fn2)
}
Here is what I have so far that create the new file, but it grabs the whole original file# file, I just need that text next to RXOCF, the example is below:
The file file#:
<RXMOP:MO=RXOCF-11;
RADIO X-CEIVER ADMINISTRATION
MANAGED OBJECT DATA
MO TEI SWVERREPL SWVERACT SIG
RXOCF-11 62 DEFAULT B0531R0702 CONC
BSSWANTED NEGSTATUS
90 SUCCESSFUL
My Script:
/RXOCF/ {
fn = FILENAME
sub(/^[^0-9]*/,"",fn)
fn1 = "file" fn
fn2 = "pre_build_c" fn
num = $2
while ((getline < fn1 ) > 0) {
gsub(/TG_TEI/,num)
print > fn2
}
close(fn1)
close(fn2)
}