Community
    • Login

    Notepad ++ place switching

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 453 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ilyassb02I Offline
      Ilyassb02
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • guy038G Online
        guy038
        last edited by guy038

        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 around option

          • Select the Regular expression search mode

          • Click on the Replace all button

        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

        Ilyassb02I 1 Reply Last reply Reply Quote 2
        • Ilyassb02I Offline
          Ilyassb02 @guy038
          last edited by

          @guy038 thank you man. worked like a charm

          1 Reply Last reply Reply Quote 1

          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors