Community

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

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

    Help wanted · · · – – – · · ·
    3
    8
    81
    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 Fernandes
      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 Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Michelle Fernandes last edited by

        @Michelle-Fernandes

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

        M Andre Z Eckenrode 1 Reply Last reply Reply Quote 1
        • M Andre Z Eckenrode
          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 Kilborn Michelle Fernandes 2 Replies Last reply Reply Quote 2
          • Alan Kilborn
            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 Eckenrode 1 Reply Last reply Reply Quote 1
            • M Andre Z Eckenrode
              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 Kilborn 1 Reply Last reply Reply Quote 1
              • Alan Kilborn
                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 Eckenrode 1 Reply Last reply Reply Quote 2
                • M Andre Z Eckenrode
                  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 Fernandes
                    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
                    Copyright © 2014 NodeBB Forums | Contributors