Find/Replace multiple lines
-
Using Search/Replace I can find “GRID=” in the following text:
1 EVEN
2 TYPE FindaGrave
2 NOTE GRID= somenumberI’d like the replacement to read:
1 EVEN
2 TYPE R
2 ADDR somenumber
2 NOTE GRID=somenumberI need to be able store “somenumber” and use that number (it changes) to create the replacement example multiple times in the text file (it’s a GEDcom file). Can this be done in one pass?
-
@Dave-C-1 said in Find/Replace multiple lines:
Can this be done in one pass?
Using regular expression search, yes.
FIND =
2 NOTE GRID=(\d+)
REPLACE =2 ADDR $1\r\n$0In the FIND, the
(\d+)says "find one or more digits and put in group#1)
In the REPLACE, the$1says “use the contents stored in group#1” and the$0says “use the full matched text”-—
Useful References
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