Page 1 of 1

find numbers and replace increased/decreased numbers

Posted: Thu Apr 16, 2009 10:53 am
by Raulka
Hi!

I would like to change lot of coordinates in more big xml files.
Find type:

Code: Select all

Left="230"
the number is 1 or 2 or 3 characters decimal number. I need to change coordinates to left with 80 pixels, so I would like to replace this with 80 increased numbers:

examples:

Code: Select all

Original:      Replaced:
Left="230" --> Left="310"
Left="10" --> Left="90"
Left="0" --> Left="80"
Help me please... I can't solve this....

Posted: Thu Apr 16, 2009 11:24 am
by MudGuard
Calculating is NOT possible with regular expressions.

Posted: Thu Apr 16, 2009 11:39 am
by Raulka
MudGuard wrote:Calculating is NOT possible with regular expressions.
Hmm... I afraid of this :-(
And any other solution without regular expression?

Posted: Thu Apr 16, 2009 11:55 am
by ben_josephs
Yes, with a script in a suitable language, such as Perl, Python, Ruby, Tcl, ECMAscript or Lua. Unfortunately, TextPad doesn't support scripts. Macros aren't powerful enough for this.