Community
    • Login

    Notepad ++ place switching

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 222 Views
    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
      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
        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
          Ilyassb02 @guy038
          last edited by

          @guy038 thank you man. worked like a charm

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors