Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how can i merge lines with condition ?

    Help wanted · · · – – – · · ·
    4
    7
    79
    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 Pham
      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

      astrosofista 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn last edited by

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

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

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

          Ekopalypse 1 Reply Last reply Reply Quote 0
          • Ekopalypse
            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 Pham 1 Reply Last reply Reply Quote 0
            • astrosofista
              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 Pham 1 Reply Last reply Reply Quote 3
              • Hai Pham
                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 Pham
                  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
                  Copyright © 2014 NodeBB Forums | Contributors