Community
    • Login

    Is there a way to add an "enter" as part of a replace command?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 4 Posters 1.4k 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.
    • Stephen KnappS Offline
      Stephen Knapp
      last edited by

      I have a wikitable that I’m compiling and I’ve got each row set as something like

      |-|4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100

      I’d like to replace each - sequence with a

      |

      But I can’t seem to figure out how to format the replace

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by

        Hello @stephen-knapp and All,

        So, if I understood you, clearly, you have lines like :

        |-|4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100
        

        and you expect this resulting text :

        |-
        |4 |Destroyer Kamikaze Class |37.5 |102.6 |9.1 |23.2 |2.9 |1398 |100
        

        Am I right about it ?

        Best Regards

        guy038

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA Online
          Alan Kilborn @Stephen Knapp
          last edited by

          @Stephen-Knapp

          To answer the direct question, which was:

          Is there a way to add an "enter" as part of a replace command?

          The answer is yes, use Regular Expression for the Search mode, and use the sequence \r\n in the Replace with box, potentially along with other text.

          1 Reply Last reply Reply Quote 2
          • guy038G Offline
            guy038
            last edited by

            Hi, @stephen-knapp, @alan-kilborn and All,

            If I presume that my guess was correct, here is the regex S/R :

            • SEARCH ^\|-

            • REPLACE $0\n in an Unix file    OR    $0\r\n in a Windows file

            • Options Wrap around and Regular expression selected

            Best Regards,

            guy038

            1 Reply Last reply Reply Quote 1
            • Thomas 2020T Offline
              Thomas 2020
              last edited by Thomas 2020

              or: Extended
              |-
              |-\r\n

              1 Reply Last reply Reply Quote 0

              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