Hi all! This post me be sorta long, so I apologize ahead of time.
Files involved:
file#
pre_build#
master_sorted
Task 1:
Begin with the first search using file# (exam: file1) and find the text RXOTG-# (exam: RXOTG-296). It may be up to 3
numerics at the end, but no more. The text in the file# where it is located to is similiar to below:
MO CELL
RXOTG-296 B00227A
B00227B
B00227C
B00227A
B00227B
B00227C
So after finding RXOTG-#, look in the file named master_sorted and compare the number at the end of RXOTG, which in this
case is 296 to the first field in the file named master_sorted (which has fields seperated by commas.) The file
master_sorted looks similiar to below:
11,11,121,100,B00055
16,16,121,100,B00058
296,96,121,100,B00345
When it finds the match 296 from file# and master_sorted field $1, grab the number in field $3 and use it instead of 296.
Meaning it will now be RXOTG-121.
So RXOTG-121 is the text we want to keep.
Finally, we want to look for the file named pre_build# (exam: pre_build1) that matches the file# we were using, and replace
the text: TG_NUM any where in the file with the text we saved RXOTG-121.
The text in the file pre_build# is exactly like below:
RXMOI:MO=RXOTG-TG_NUM,COMB=HYB,RSITE=SITE_NUMBER,SWVER=B0531R0702;
RXESI:MO=RXOTG-TG_NUM;
RXBLE:MO=RXOTG-TG_NUM;
RXMOI:MO=RXOCF-TG_NUM,TEI=TG_TEI;
RXMOC:MO=RXOCF-TG_NUM,SIG=CONC;
RXMOI:MO=RXOIS-TG_NUM;
RXMOI:MO=RXOTF-TG_NUM,TFMODE=SA;
RXMOI:MO=RXOCON-TG_NUM,DCP=64&&87;
So we would end up with the following text inside the pre_build1 file.:
RXMOI:MO=RXOTG-121,COMB=HYB,RSITE=SITE_NUMBER,SWVER=B0531R0702;
RXESI:MO=RXOTG-121;
RXBLE:MO=RXOTG-121;
RXMOI:MO=RXOCF-121,TEI=TG_TEI;
RXMOC:MO=RXOCF-121,SIG=CONC;
RXMOI:MO=RXOIS-121;
RXMOI:MO=RXOTF-121,TFMODE=SA;
RXMOI:MO=RXOCON-121,DCP=64&&87;
The script needs to keep the files named the same in order to accomplish what I need when finalized. It also needs to keep
processing until it has finished all the file# files and written to the pre_build# files. I hope this was not too confusing!
Thanks,
Beaster
Files involved:
file#
pre_build#
master_sorted
Task 1:
Begin with the first search using file# (exam: file1) and find the text RXOTG-# (exam: RXOTG-296). It may be up to 3
numerics at the end, but no more. The text in the file# where it is located to is similiar to below:
MO CELL
RXOTG-296 B00227A
B00227B
B00227C
B00227A
B00227B
B00227C
So after finding RXOTG-#, look in the file named master_sorted and compare the number at the end of RXOTG, which in this
case is 296 to the first field in the file named master_sorted (which has fields seperated by commas.) The file
master_sorted looks similiar to below:
11,11,121,100,B00055
16,16,121,100,B00058
296,96,121,100,B00345
When it finds the match 296 from file# and master_sorted field $1, grab the number in field $3 and use it instead of 296.
Meaning it will now be RXOTG-121.
So RXOTG-121 is the text we want to keep.
Finally, we want to look for the file named pre_build# (exam: pre_build1) that matches the file# we were using, and replace
the text: TG_NUM any where in the file with the text we saved RXOTG-121.
The text in the file pre_build# is exactly like below:
RXMOI:MO=RXOTG-TG_NUM,COMB=HYB,RSITE=SITE_NUMBER,SWVER=B0531R0702;
RXESI:MO=RXOTG-TG_NUM;
RXBLE:MO=RXOTG-TG_NUM;
RXMOI:MO=RXOCF-TG_NUM,TEI=TG_TEI;
RXMOC:MO=RXOCF-TG_NUM,SIG=CONC;
RXMOI:MO=RXOIS-TG_NUM;
RXMOI:MO=RXOTF-TG_NUM,TFMODE=SA;
RXMOI:MO=RXOCON-TG_NUM,DCP=64&&87;
So we would end up with the following text inside the pre_build1 file.:
RXMOI:MO=RXOTG-121,COMB=HYB,RSITE=SITE_NUMBER,SWVER=B0531R0702;
RXESI:MO=RXOTG-121;
RXBLE:MO=RXOTG-121;
RXMOI:MO=RXOCF-121,TEI=TG_TEI;
RXMOC:MO=RXOCF-121,SIG=CONC;
RXMOI:MO=RXOIS-121;
RXMOI:MO=RXOTF-121,TFMODE=SA;
RXMOI:MO=RXOCON-121,DCP=64&&87;
The script needs to keep the files named the same in order to accomplish what I need when finalized. It also needs to keep
processing until it has finished all the file# files and written to the pre_build# files. I hope this was not too confusing!
Thanks,
Beaster