Deleting multiple lines
-
I know it’s possible but I think I’m having a senior moment ( or brainfart) but I want to delete segments of code from <string> to </string> that spans multiple lines in lots of places with different text in the same file. This is from a game that publishes a discoveries file to help plugin makers find and use the appropriate itemID and itemNames within their plugin.
For example:
<FirstLearnedBy>
<ServerNameA>AlphaShard</ServerName>
<Player>JohnDoe</Player>
<Guild>HomeBros</Guild>
<Date>June 12, 2015</Date>
<ServerNameB>BravoShard</ServerName>
<Player>JaneWest</Player>
<Guild>RealGirrrls</Guild>
<Date>April 24, 2015</Date>
</FirstLearnedBy>That goes on for about 60-72 lines and spams the file. I obviously don’t need it for my addon but sitting here deleting each section takes ages in a 500,000+ file for every recipe in the game. I’m also deleting the non-English translations of each recipe and material used.
Thanks in advance for any help.
-
@Norson-Teeferly I think you could use regex in Find/Replace form. You could try/learn regex - http://regexr.com/
-
So for what you’ve specified, the following should work:
Find what:
(?s)<FirstLearnedBy>.+?</FirstLearnedBy>
Replace with: make sure this box is empty
Search mode:Regular expression -
That did the trick. Thank you.
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