Community
    • Login

    how can i merge lines with condition ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 881 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.
    • Hai PhamH Offline
      Hai Pham
      last edited by

      if i have 3 lines and i want to merge the line which less than 10 word to the line above how can i do it ?
      57707b2c-e5aa-4eba-90d1-548a35bbf163-image.png
      and here how i want it to be
      31388e99-35b8-489c-a83b-0691c5163e37-image.png

      astrosofistaA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn
        last edited by

        I think you need more specification, as all lines shown have less than 10 words…

        Hai PhamH 1 Reply Last reply Reply Quote 1
        • Hai PhamH Offline
          Hai Pham @Alan Kilborn
          last edited by

          @Alan-Kilborn ops sorry,hmm i mean less than the number i want =.=

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE Offline
            Ekopalypse @Hai Pham
            last edited by

            @Hai-Pham

            I’m sorry, but it didn’t become any clearer for me.
            Could it be that you want to append the lines which ONLY have a certain number of words to the previous line?

            Something like if a line has less than 10 words,
            then append it to the previous line?

            Hai PhamH 1 Reply Last reply Reply Quote 0
            • astrosofistaA Offline
              astrosofista @Hai Pham
              last edited by

              Hi @Hai-Pham

              If I correctly interpreted the question —chars instead of words—, the following regex will help you:

              Search: \R^(.{1,9})$
              Replace: \x20$1
              

              Put the caret at the very beginning of the document, select just the Regular Expressions mode and click on Replace All.

              Have fun!

              Hai PhamH 1 Reply Last reply Reply Quote 3
              • Hai PhamH Offline
                Hai Pham @Ekopalypse
                last edited by

                @Ekopalypse thk u so much for paying attention to my question, i have the answer now !!!

                1 Reply Last reply Reply Quote 1
                • Hai PhamH Offline
                  Hai Pham @astrosofista
                  last edited by

                  @astrosofista That’s exactly what im talking about,Thank u so much,appreciate that !!!

                  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