I have a series of variables like so:
NUMBEROFPASSES=$((($BLACKCUTDEPTH-$SURFACE )/$BLACKPASS)) #is 34
Text To Edit:
!PZ-325,200; snip here (inclusive)SP6 is a known/usable starting point
PU9170,-10213; snip stops here inclusive BEFORE the next SPx line
What I need to do is take the snip and duplicate it and paste it at the end snip point (before the next SPx) over and over via a loop I already have based on $NUMBEROFPASSES. As each snip gets pasted in line the !PZ-xxx,200 needs to be changed in relation to the diff $BLACKCUTDEPTH-$SURFACE which is 242. I need the number 242 equally divided up over the number of snips and the increasing incremental diff. patched where the xxx is in !PZ-xxx,200 until in this case $BLACKCUTDEPTH 567 is reached.(the first !PZ-xxx,200 is left alone and all following strings have the patch applied increasing in numerical value. The 200 stays constant as do the SP6; and others SP#'s. The size of the snip will vary from a few lines to a thousand. The needed code will be used for SP1 through SP7 but I will duplicate and edit code for each SPx as needed.
Can this be achieved via sed and awk? I sure hope so.