Deleting specific amount of lines
-
Hi everyone, I was wondering if npp++ is able to remove specific line amounts. For an example, I’m writing in a code that relies on removing things, here’s the example
Prerequisites
Object = AmericaWarFactory
Object = AmericaStrategyCenter
EndWhat I want to achieve is basically a layout where it starts from Prerequisites to End, I want to remove those. however the situation is the End Keyword. In my text files, there are multiple ends, because what comes with that quote is
Prerequisites
Object = AmericaWarFactory
Object = AmericaStrategyCenter
EndExperienceValue = 75 100 125 150 ;Experience point value at each level
ExperienceRequired = 0 200 437 750 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experienceWeaponSet
Conditions = None
Weapon = PRIMARY TomahawkMissileWeapon
EndI basically only want the code to focus on the Prerequisite to the very next end line, so the outcome achieved will end up looking like this
ExperienceValue = 75 100 125 150 ;Experience point value at each level
ExperienceRequired = 0 200 437 750 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experienceWeaponSet
Conditions = None
Weapon = PRIMARY TomahawkMissileWeapon
End
Is this possible at all? -
Yes, I think it’s possible. Try the following regex:
Find: (?s)^Prerequisites.*?End\R+Leave the
replacefield empty.Have fun!
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