I have files containing strings like
#define PROG_HWNR "#37595" #define C_HWPROG_NR "24499" #define PROG_HWNR "#39917" #define C_HWPROG_NR "24901" #define C_HWPROG_NR "37598"
I put them in a file called regex-test (for testing purposes)
What I want to do is increase each number by one. There are other #defines and numbers that should not be increased, I have a list of all the variable names that need to be increased.
I already have a PowerShell command, for example
Get-Content regex-test | foreach { [regex]::match($_,'"#?(\d+)"$').groups[1].value }
which returns numbers. Now they need to be replaced only by [value] + 1
Can you point me in the right direction? Thanks!
source share