I am trying to figure out a way to replace a string in a text file by a number that increments by more than 1. I am trying to turn a couple of lines like this:
result_A_in_S1-S2.txt
result_A_in_S1-S2.txt
result_A_in_S1-S2.txt
result_A_in_S1-S2.txt
Into something that scales up sequentially for S1
and S2
.
result_A_in_1000-1003.txt
result_A_in_1004-1007.txt
result_A_in_1008-1011.txt
result_A_in_1012-1015.txt
I want to know if I can define a string with replace regexp and then have that string be replaced with some starting number, and as it finds the next occurrence of string, it replaces with starting number + chosen increment.
I am just now starting learn Emacs and am pretty unfamiliar with it.