Halving multiple numbers
Torn 22 last edited by
I have a 10k line long .txt file which contains many set parameters for a game
There is one specific every number of which I need to halve, it looks like this:
gold_cost = number
This may look very simple yet I haven’t found a way to do this in Notepad++.
Terry R last edited by
There is one specific every number of which I need to halve,
Regular expressions in Notepad++are not capable of doing calculations like you require.
I do however remember some old posts in this forum where using PytonScript achieves what you need
Do some searching here using pythonscript and calculation as key words and I think you will find the relevant posts.
I’m not on a PC currently so cannot provide those links currently.
PeterJones last edited by
Further to @Terry-R’s suggestion, if you search for “add_1”, you will find examples of such calculation (because the PythonScript documentation has an example that adds one to each integer found). All you have to do is take that
add_1example and switch
/ 2to change from adding 1 to dividing by 2 (halving).