I have multiple files named like below:
pre_build_out1
pre_build_out2
pre_build_out3
(may have more or less at anytime)
In these above files is the text:
TRU_ZERO
TRU_ONE
TRU_TWO
TRU_THREE
TRU_FOUR
TRU_FIVE
TRU_SIX
TRU_SEVEN
TRU_EIGHT
TRU_NINE
TRU_TEN
TRU_ELEVEN
In the second set of files:
file1
file2
file3
(may have more or less at anytime)
There is the text:
RXOTX-#-# (Example RXOTX-123-0)
RXOTX-#-# (Example RXOTX-123-6)
RXOTX-#-# (Example RXOTX-123-11)
There may be anywhere from 0-11, but no more for the last number.
I need a script to look in the files named file# one by one looking for the text RXOTX and grab the second number, in the case above it would be 0 , 6 , and 11. Take those numbers and replace them in the cooresponding pre_build_out# files.
So using file1, finding RXOTX-123-0, RXOTX-123-6, RXOTX-123-11 the script would go in to the pre_build_out1 and replace TRU_ZERO with 0, TRU_SIX with 6, and TRU_ELEVEN with 11.
The output file should be called pre_build_a_# using the same number as the pre_build_out# file.
pre_build_out1
pre_build_out2
pre_build_out3
(may have more or less at anytime)
In these above files is the text:
TRU_ZERO
TRU_ONE
TRU_TWO
TRU_THREE
TRU_FOUR
TRU_FIVE
TRU_SIX
TRU_SEVEN
TRU_EIGHT
TRU_NINE
TRU_TEN
TRU_ELEVEN
In the second set of files:
file1
file2
file3
(may have more or less at anytime)
There is the text:
RXOTX-#-# (Example RXOTX-123-0)
RXOTX-#-# (Example RXOTX-123-6)
RXOTX-#-# (Example RXOTX-123-11)
There may be anywhere from 0-11, but no more for the last number.
I need a script to look in the files named file# one by one looking for the text RXOTX and grab the second number, in the case above it would be 0 , 6 , and 11. Take those numbers and replace them in the cooresponding pre_build_out# files.
So using file1, finding RXOTX-123-0, RXOTX-123-6, RXOTX-123-11 the script would go in to the pre_build_out1 and replace TRU_ZERO with 0, TRU_SIX with 6, and TRU_ELEVEN with 11.
The output file should be called pre_build_a_# using the same number as the pre_build_out# file.