I was wondering if I could get some help on looking for specific text, and grabbing
only a certain range below it. My input file file# (Dont know how may there could be)
has the text DCP in it. Directly under this text there will be numbers. The
numbers may be any number from 1-24 and may or may not be in numerical order.
See example below:
RXOTX-16-3 CONFIG HOP 8 43 NO NONE
RXOTX-16-4 CONFIG 625 1 41 YES NONE
RXOTX-16-5 CONFIG HOP 3 41 NO NONE
RXOTX-16-6 CONFIG HOP 4 41 NO NONE
RXOTX-16-7 CONFIG HOP 5 41 NO NONE
RXOTX-16-8 CONFIG 633 0 41 YES NONE
RXOTX-16-9 CONFIG HOP 9 41 NO NONE
RXOTX-16-10 CONFIG HOP 10 41 NO NONE
END
<RXAPP:MO=RXOTG-16;
RADIO X-CEIVER ADMINISTRATION
ABIS PATH STATUS
MO
RXOTG-16
DEV DCP APUSAGE APSTATE
RBLT24-384 1 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-385 2 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-386 3 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-387 4 MPLEX32 IDLE
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-388 5 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-389 6 MPLEX16 SPEECH/DATA
END
The word "END" will appear many times in the input file, but may be a reference point to
know where to stop looking. This part confuses me, so I will leave it up to whoever can
help.
All I need is to grab the first number below the DCP and the last number in the column
under the DCP text and replace the text DCP_FIRST with the first number, and DCP_SECOND
with the second number in the corresponding pre_build_h# file. (file1 with pre_build_h1
and so on) and then output to pre_build_i# (Use the number at the end of the input files,)
In the above text it would find the numbers 1 and 6. 1 would be DCP_FIRST and 6 would be
substituted for DCP_SECOND in the pre_build_h# file.
The pre_build_h# file looks like below:
RXMOI:MO=RXOTF-152,TFMODE=SA;
RXMOI:MO=RXOCON-152,DCP=64&&87;
DTBLEIP=223RBLT;
EXDAIEV=DEVICE_RANGE;
BLODEEV=DEVICE_RANGE;
RXAPI:MO=RXOTG-152,DEV=DEVICE_RANGE,DCP=FIRST_DCP&&SECOND_DCP;
only a certain range below it. My input file file# (Dont know how may there could be)
has the text DCP in it. Directly under this text there will be numbers. The
numbers may be any number from 1-24 and may or may not be in numerical order.
See example below:
RXOTX-16-3 CONFIG HOP 8 43 NO NONE
RXOTX-16-4 CONFIG 625 1 41 YES NONE
RXOTX-16-5 CONFIG HOP 3 41 NO NONE
RXOTX-16-6 CONFIG HOP 4 41 NO NONE
RXOTX-16-7 CONFIG HOP 5 41 NO NONE
RXOTX-16-8 CONFIG 633 0 41 YES NONE
RXOTX-16-9 CONFIG HOP 9 41 NO NONE
RXOTX-16-10 CONFIG HOP 10 41 NO NONE
END
<RXAPP:MO=RXOTG-16;
RADIO X-CEIVER ADMINISTRATION
ABIS PATH STATUS
MO
RXOTG-16
DEV DCP APUSAGE APSTATE
RBLT24-384 1 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-385 2 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-386 3 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-387 4 MPLEX32 IDLE
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-388 5 MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
MPLEX16 SPEECH/DATA
RBLT24-389 6 MPLEX16 SPEECH/DATA
END
The word "END" will appear many times in the input file, but may be a reference point to
know where to stop looking. This part confuses me, so I will leave it up to whoever can
help.
All I need is to grab the first number below the DCP and the last number in the column
under the DCP text and replace the text DCP_FIRST with the first number, and DCP_SECOND
with the second number in the corresponding pre_build_h# file. (file1 with pre_build_h1
and so on) and then output to pre_build_i# (Use the number at the end of the input files,)
In the above text it would find the numbers 1 and 6. 1 would be DCP_FIRST and 6 would be
substituted for DCP_SECOND in the pre_build_h# file.
The pre_build_h# file looks like below:
RXMOI:MO=RXOTF-152,TFMODE=SA;
RXMOI:MO=RXOCON-152,DCP=64&&87;
DTBLEIP=223RBLT;
EXDAIEV=DEVICE_RANGE;
BLODEEV=DEVICE_RANGE;
RXAPI:MO=RXOTG-152,DEV=DEVICE_RANGE,DCP=FIRST_DCP&&SECOND_DCP;