I have this lines :
_____0000_____
_____0000_____
_____0000_____
_____0000_____
....
I want to replace the 0000 with increment padded number ( incremented by 10) :
_____0010_____
_____0020_____
_____0030_____
_____0040_____
....
_____0090_____
_____0100_____
_____0110_____
2
Answers
you can use the extension I wrote: Regex Text Generator
0000
part of every line.0000
and then useCtrl+D
to select a few more0000
,Ctrl+F
Alt+Enter
.*
{{=(i+1)*10:size(4)}}
If you have blank lines and want to generate the whole text use:
Shift+Alt+Click
on last line.*
_____{{=(i+1)*10:size(4)}}_____
If you need to do this regular you can define a preset in the settings with these properties that are editable when selected.
This is very easy with an extension I wrote, Find and Transform. With it you can select what you want to replace with a
find
regex and do the math to construct the replacement.Try this keybinding (in your
keybindings.json
or it could be a command):There are many more options in the extension if you need them. Demo: