Community
    • Login

    how can i merge lines with condition ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 4 Posters 383 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.
    • Hai PhamH
      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
        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
          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
            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
              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
                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
                  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
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors