Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Login

    How to insert blank line in between every line

    Help wanted · · · – – – · · ·
    5
    12
    3.8k
    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.
    • Sean ShafferS
      Sean Shaffer
      last edited by

      Is there a way to easily “double-space” my document by inserting a blank line in between every line I have selected or all lines in the document? I don’t see a one-click solution for this under Edit->Line Operations

      andrecool-68A 1 Reply Last reply Reply Quote 0
      • andrecool-68A
        andrecool-68 @Sean Shaffer
        last edited by andrecool-68

        @Sean-Shaffer
        Option Find and Replace
        Find: $
        Replace: \n
        This will add an empty line to each line.

        Alan KilbornA 1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @andrecool-68
          last edited by

          @andrecool-68

          Hmmmmmm. Well, that might be bad if the OP is using anything other than Unix/Linux line endings. Plus, I wouldn’t think that the user would want to turn blank lines into a bigger section of blank lines.

          I’d try:

          Find: ^.+(\R)
          Replace: $0\1
          Search mode: Regular expression

          Alan KilbornA A3 W2A 2 Replies Last reply Reply Quote 5
          • Alan KilbornA
            Alan Kilborn @Alan Kilborn
            last edited by

            To be better, go with:

            Find: (?-s)^.+(\R)

            (…since we don’t know the user’s setting of the . matches newline checkbox. The above change makes that checkbox’s setting irrelevant.)

            A3 W2A 1 Reply Last reply Reply Quote 3
            • Alan KilbornA
              Alan Kilborn
              last edited by

              Alternatively, a well-placed ? in the original would have made it okay, even without the (?-s) and without caring about the checkbox setting:

              Find: ^.+?(\R)

              And no, Peter, repeated postings by me here is not a veiled attempt for more upvotes. :)

              EkopalypseE 1 Reply Last reply Reply Quote 3
              • EkopalypseE
                Ekopalypse @Alan Kilborn
                last edited by

                @Alan-Kilborn

                hmm - what about
                find: \R
                replace: $0$0
                ?
                ;-)

                Alan KilbornA 1 Reply Last reply Reply Quote 3
                • Alan KilbornA
                  Alan Kilborn @Ekopalypse
                  last edited by Alan Kilborn

                  @Ekopalypse

                  For me, that puts too much “blankness” in certain spots (say, between “paragraphs”). But since we have no idea really what the OP wants for this circumstance…

                  1 Reply Last reply Reply Quote 4
                  • Sean ShafferS
                    Sean Shaffer
                    last edited by

                    I’m editing a list of trackers for torrenting. For better readability, I want each line to be spaced apart. For example,

                    http://5.79.83.193:2710/announce
                    http://5.79.249.77:6969/announce
                    http://37.19.5.139:6969/announce
                    would become:
                    http://5.79.83.193:2710/announce

                    http://5.79.249.77:6969/announce

                    http://37.19.5.139:6969/announce

                    A3 W2A 1 Reply Last reply Reply Quote 1
                    • Sean ShafferS
                      Sean Shaffer
                      last edited by

                      Alan Kilborn provided the correct Find/Replace solution. Thank you!

                      1 Reply Last reply Reply Quote 4
                      • A3 W2A
                        A3 W2 @Alan Kilborn
                        last edited by

                        @Alan-Kilborn That worked for me, Thanks.
                        Had same problem with separating a list of trackers as OP.

                        1 Reply Last reply Reply Quote 0
                        • A3 W2A
                          A3 W2 @Sean Shaffer
                          last edited by

                          @Sean-Shaffer It’s not just for readability. It simply doesn’t work other way. I mean when you copy-paste a list of trackers - it has to be line separated like that, otherwise it just doesn’t work (talking uTorrent here).
                          So when i update the list in Notepad++ i hit “remove duplicates” and that also removes empty lines between addresses. So then i need to put them back, which this post helped me do. Nice, thanks everybody.

                          1 Reply Last reply Reply Quote 0
                          • A3 W2A
                            A3 W2 @Alan Kilborn
                            last edited by

                            @Alan-Kilborn said in How to insert blank line in between every line:

                            Find: (?-s)^.+(\R)

                            typing this in Find does nothing and some small windows opens :) trying to use Replace messes up whole document, leaving only 2 lines there.
                            1st suggestion work fine, but that second idk, i wasn’t able to make it work.

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