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 expressionthen 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_rateentries only, please enter the following:find what:
spawn_rate : (\d.\d\d)
replace with:spawn_rate : 0.01
search mode:regular expressionps: 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login