Replace numbers in stings with another number by adding fixed amount to it

by Jun 16, 2013

I am a beginner, sorry.

I think I can replace numbers in a file called "Test.txt" like this (correct me if wrong)

(Get-Content C:ScriptsTest.txt) |
Foreach-Object {$_ -replace "start="20"", "start="40""} |
Set-Content C:ScriptsTest.txt

However my problem is that I want to replace a number in a string with another number that is a fixed amount less than the number I am replacing.

My strings go like this

And what I need to do is deduct 1342177280 from each number giving me


Or, setting each value to "0" then incrementing each by 262144 would also work.

There are other numbers in the strings so it is best to replace the complete start="<number>".

Is this possible in PowerShell? I think Perl can do it, but PowerShell may be more convenient.