I have a number of lines in a file, and I would like to copy each line 11 times (turning each line into 12 lines), and increment the last "1" in each line so that the 12 lines have "1" through "12", where the "1" initially was. There may be other occurrences of "1" in each line, but the "1" I want to increment will always be the last occurrence in each line. Another way to look at it is that the last "1" is always after "/nt/" - as in "/nt/1" (and it will always be the only occurrence of "/nt/1" in each line).
So, for example, if I have:
1stlineblahblahblah/nt/1blah 2ndlineblahblahblah/nt/1blah 3rdlineblahblahblah/nt/1blah
I want to turn it into:
1stlineblahblahblah/nt/1blah 1stlineblahblahblah/nt/2blah 1stlineblahblahblah/nt/3blah 1stlineblahblahblah/nt/4blah 1stlineblahblahblah/nt/5blah 1stlineblahblahblah/nt/6blah 1stlineblahblahblah/nt/7blah 1stlineblahblahblah/nt/8blah 1stlineblahblahblah/nt/9blah 1stlineblahblahblah/nt/10blah 1stlineblahblahblah/nt/11blah 1stlineblahblahblah/nt/12blah 2ndlineblahblahblah/nt/1blah 2ndlineblahblahblah/nt/2blah 2ndlineblahblahblah/nt/3blah ...
I had previously found the command:
:for i in range(0,12) | put ='1stlineblahblahblah/nt/'.i.'blah' | endfor
works for this purpose, but I would have to manually run this command for each line, and type each line in (or copy-and paste it) myself. Is there a way to take the lines that are already in the file, and just run one command that turns each line into twelve, in the manner that I've described?
Thanks in advance to anyone who can help me with this. I also just wanted to note that this is my second question here, and I was pleased to have gotten several quick and effective solutions to my first question, for which I was most grateful.