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 981 Views 2 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.
    • Michelle FernandesM Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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 Offline
                  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 Offline
                    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

                    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