find numbers and replace increased/decreased numbers

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Raulka
Posts: 2
Joined: Thu Apr 16, 2009 10:40 am

find numbers and replace increased/decreased numbers

Post 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....
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Calculating is NOT possible with regular expressions.
Raulka
Posts: 2
Joined: Thu Apr 16, 2009 10:40 am

Post by Raulka »

MudGuard wrote:Calculating is NOT possible with regular expressions.
Hmm... I afraid of this :-(
And any other solution without regular expression?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
Post Reply