in reply to Modifying a file using RegEx

I'm not sure exactly what your data looks like. How many lines are then to be replaced? Do the step numbers change and if they do, how? So i came up with a candidate data file that looks like this:

-----------step 1.
-----------step 1.
-----------step 1.
-----------step 2.
-----------step 1.
-----------step 1.
-----------step 1.
-----------step 2.
-----------step 2.
-----------step 2.
-----------step 3.
-----------step 3.
-----------step 2.
-----------step 2.
-----------step 3.
-----------step 3.

The following one liner will transform the data into hopefully something that is very close to want you want.

perl -pi -e's/(-----------step\s+)(\d+)\./$h{$2}||=$2;$h{$2}+=.1;$1.$h +{$2}/ge' foo.txt; cat foo.txt -----------step 1.1 -----------step 1.2 -----------step 1.3 -----------step 2.1 -----------step 1.4 -----------step 1.5 -----------step 1.6 -----------step 2.2 -----------step 2.3 -----------step 2.4 -----------step 3.1 -----------step 3.2 -----------step 2.5 -----------step 2.6 -----------step 3.3 -----------step 3.4
If not, then please feel free to post more examples of the data you are working with.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)