Sublime Forum

Multiply values

#1

I have XML files that I need to edit in certain parts. I need to multiply a value in thousands of places and I am trying to figure out a short cut to do it.

It’s for example <.Price.>44<./Price.> that I want to change to <.Price.>88<./Price.>.
What I am doing as of now is using the replace command (CTRL + H) and then manually entering the values and then using quick command CTRL + ALT + ENTER for replace all which works great in the instances when there are multiple identical numbers. But since I have many hundreds of individual files this is not going to solve the problem.

I have tried to copy all the values into excel by using the find function, CTRL + F and writing <./Price.> and gathering all the numbers in one go, and copying them to excel and then using a *2 formula in the hopes that I could just copy and paste them back into Sublime, but that doesn’t work as any mass copy of selected data just goes to the very bottom of the XLM file in Sublime.

Is there any way to do this with Sublime or can someone recommend any other software or method?

1 Like

#2

You can do this using the arithmetic command. Simply select all the numbers you want to double, run the arithmetic command from the command palette and type x * 2.

1 Like

#3

Awesome, thank you so much!!

0 Likes

#4

Here’s a great video about this amazing feature by OdatNurd: [CQ33] The super powers of the secret Arithmetic command!.

0 Likes