I need a batch file that will search for the string “Gen_1_X”. When the string is found and lets say the “X” is a “4” the script will add “Gen_1_3” before and “Gen_1_5” before and after. Basically adding and subtracting one from the original number and adding the new entries before and after accordingly. The first block of code is what the end product should look like. The second block is what you have to work with.
<span class="O verse Gen_1_3" data-osis="Gen.1.3"><span class="verse-num v-4">4
<span class="O verse Gen_1_4" data-osis="Gen.1.4"><span class="verse-num v-4">4 </span></span>
<span class="O verse Gen_1_5" data-osis="Gen.1.5"><span class="verse-num v-4">4
<span class="O verse Gen_1_5" data-osis="Gen.1.5"><span class="verse-num v-5">5 </span></span>
<span class="O verse Gen_1_6" data-osis="Gen.1.6"><span class="verse-num v-6">6 </span></span>
<span class="O verse Gen_1_7" data-osis="Gen.1.7"><span class="verse-num v-7">7 </span></span>
<span class="O verse Gen_1_8" data-osis="Gen.1.8"><span class="verse-num v-8">8 </span></span>
<span class="O verse Gen_1_9" data-osis="Gen.1.9"><span class="verse-num v-9">9 </span></span>
Notes:
1- Previous Batch file ends at the first empty line in the input file. This may be solved, if needed.
2- There are certain restrictions in the input lines. Some may be solved, but some not. Please do a test and report the result.
3- I suppose that input lines does not have $ characters. If so, change the $ in the Batch file by another unused character.
EDIT: I fixed a small bug that does not update the number in Gen.1.X part.