• Login
Community
  • Login

how can i merge lines with condition ?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
7 Posts 4 Posters 396 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.
  • H
    Hai Pham
    last edited by Jan 2, 2021, 2:36 AM

    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

    A 1 Reply Last reply Jan 2, 2021, 1:41 PM Reply Quote 0
    • A
      Alan Kilborn
      last edited by Jan 2, 2021, 12:55 PM

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

      H 1 Reply Last reply Jan 2, 2021, 1:04 PM Reply Quote 1
      • H
        Hai Pham @Alan Kilborn
        last edited by Jan 2, 2021, 1:04 PM

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

        E 1 Reply Last reply Jan 2, 2021, 1:40 PM Reply Quote 0
        • E
          Ekopalypse @Hai Pham
          last edited by Jan 2, 2021, 1:40 PM

          @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?

          H 1 Reply Last reply Jan 2, 2021, 2:16 PM Reply Quote 0
          • A
            astrosofista @Hai Pham
            last edited by Jan 2, 2021, 1:41 PM

            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!

            H 1 Reply Last reply Jan 2, 2021, 2:16 PM Reply Quote 3
            • H
              Hai Pham @Ekopalypse
              last edited by Jan 2, 2021, 2:16 PM

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

              1 Reply Last reply Reply Quote 1
              • H
                Hai Pham @astrosofista
                last edited by Jan 2, 2021, 2:16 PM

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

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