Notepad ++ place switching
-
Hello im Trying to set custom aliases for a plugin and i encountered this problem:
i have a custom_aliases.yml file im working on and it goes like this
BOOKSHELF: Bookshelf
HAY_BLOCK: HayBale
HONEY_BLOCK: HoneyBlock
MAGMA_BLOCK: MagmaBlock
etc…
but i want it the other way around like:
Bookshelf: BOOKSHELF
HayBale: HAY_BLOCK
etc…
doing them manually will take ages since i have about 7000 lines
i tried to use the search and replace feature but no luck so far -
Hello, @ilyassb02 and All,
Child’s play with regular expressions !
-
Open your file in N++
-
Open the Replace dialog (
Ctrl + H)-
SEARCH
(?-s)^(.+)(:\x20)(.+) -
REPLACE
\3\2\1 -
If necessary, tick the
Wrap aroundoption -
Select the
Regular expressionsearch mode -
Click on the
Replace allbutton
-
Et voilà !
Notes :
-
We separate the line contents in three groups, with the “colon + space” chars as a pseudo-delimiter
-
In replacement, we rewrite the last part of lines, then the colon + space delimiter and, finally, the first part of lines
Best regards
guy038
-
-
@guy038 thank you man. worked like a charm
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