Replace part of an expression from a line, in many documents
-
Hi guys, ive been using notepad++ for a few years but i never started to actually USE it. If you know what i mean lol.
The thing is, i tried to find a guide about regular expressions but im completely lost and its everything too overwheelming.
I have several documents, and in all of em there is a line that follows as ->
spawn_rate : 0.05
So, the number is the thing i want to replace. I want to search in all documents the lines with spawn_rate : xx and replace em with spawn_rate: 0.01 (a fixed number for all lines).
Thanks in advance!.
-
welcome to the notepad++ community, @George-RJ
if you want to replace all digits, that match the pattern
1.23
, open the replace window and enter the following:find what:
(\d.\d\d)
replace with:0.01
search mode:regular expression
then either replace one by one, or hit replace all.
note: if those numbers also exist on positions you don’t want to replace, and you want to explicitly replace
spawn_rate
entries only, please enter the following:find what:
spawn_rate : (\d.\d\d)
replace with:spawn_rate : 0.01
search mode:regular expression
ps: if regex isn’t too overwhelming in general, please have a look at this faq section on where to find some understandable regex documentation for beginners:
https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentationbest regards.