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 631 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
      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
        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
          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
            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
              Thomas 2020
              last edited by Thomas 2020

              or: Extended
              |-
              |-\r\n

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