Community
    • Login

    How to merge 2 separate lines into 1 line for a numerous amount of data?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 430 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.
    • Michelle FernandesM
      Michelle Fernandes
      last edited by

      Text:
      red, blue, green, orange
      ,black
      red, blue, green, orange
      ,black
      red, blue, green, orange
      ,black

      What I need:
      red, blue, green, orange, black
      red, blue, green, orange, black
      red, blue, green, orange, black

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Michelle Fernandes
        last edited by

        @Michelle-Fernandes

        Find: (?-s)^(.+)\R(.)
        Repl: ${1}${2}
        Search mode: Regular expression

        M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 1
        • M Andre Z EckenrodeM
          M Andre Z Eckenrode @Alan Kilborn
          last edited by

          @Alan-Kilborn said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

          Find: (?-s)^(.+)\R(.)
          Repl: ${1}${2}

          Actually, looks like a space is wanted between , and black, where there was none before (though not sure if that was just a typo), so slight adjustment:

          FIND: (?-s)^(.+)\R,(.)
          REPLACE: ${1}, ${2}

          Alan KilbornA Michelle FernandesM 2 Replies Last reply Reply Quote 2
          • Alan KilbornA
            Alan Kilborn @M Andre Z Eckenrode
            last edited by

            @M-Andre-Z-Eckenrode said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

            so slight adjustment

            Well, if OP couldn’t make that slight adjustment by themselves, we’ve got some bigger problems…

            M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 1
            • M Andre Z EckenrodeM
              M Andre Z Eckenrode @Alan Kilborn
              last edited by

              @Alan-Kilborn said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

              Well, if OP couldn’t make that slight adjustment by themselves, we’ve got some bigger problems…

              Yeah, I guess… but I tend to operate on the assumption that there are others out there like me, who often struggle to distinguish forest from tree (hey, that rhymes!), and wish to help on the rare occasions I’m able. :-)

              Alan KilbornA 1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn @M Andre Z Eckenrode
                last edited by

                @M-Andre-Z-Eckenrode said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

                wish to help on the rare occasions I’m able

                Totally fine.

                What scares me is someone asking a question, like the OP’s, taking the answers and doing what they need to immediately, but yet being afraid to experiment with the answers by trying things with them, and maybe learning something in the process. So that maybe next time they don’t have to ask, or maybe can help someone else out (like you did).

                M Andre Z EckenrodeM 1 Reply Last reply Reply Quote 2
                • M Andre Z EckenrodeM
                  M Andre Z Eckenrode @Alan Kilborn
                  last edited by

                  @Alan-Kilborn said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

                  yet being afraid to experiment with the answers by trying things with them, and maybe learning something in the process. So that maybe next time they don’t have to ask, or maybe can help someone else out (like you did).

                  It would certainly be great if everybody had the same capacity to experiment and learn, but that’s unfortunately not the case, in my experience. Speaking for myself, I often do experiment, and hope to learn, but have a tendency to get discouraged when my experiments lead to more questions, as seen in my “Replace character in capture group” thread.

                  1 Reply Last reply Reply Quote 2
                  • Michelle FernandesM
                    Michelle Fernandes @M Andre Z Eckenrode
                    last edited by

                    @M-Andre-Z-Eckenrode said in How to merge 2 separate lines into 1 line for a numerous amount of data?:

                    ${1}, ${2}

                    Thank you! This worked.

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