• Login
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 447 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.
  • M
    Michelle Fernandes
    last edited by Oct 30, 2020, 7:43 PM

    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

    A 1 Reply Last reply Oct 30, 2020, 7:59 PM Reply Quote 0
    • A
      Alan Kilborn @Michelle Fernandes
      last edited by Oct 30, 2020, 7:59 PM

      @Michelle-Fernandes

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

      M 1 Reply Last reply Oct 30, 2020, 11:21 PM Reply Quote 1
      • M
        M Andre Z Eckenrode @Alan Kilborn
        last edited by Oct 30, 2020, 11:21 PM

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

        A M 2 Replies Last reply Oct 30, 2020, 11:23 PM Reply Quote 2
        • A
          Alan Kilborn @M Andre Z Eckenrode
          last edited by Oct 30, 2020, 11:23 PM

          @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 1 Reply Last reply Oct 30, 2020, 11:35 PM Reply Quote 1
          • M
            M Andre Z Eckenrode @Alan Kilborn
            last edited by Oct 30, 2020, 11:35 PM

            @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. :-)

            A 1 Reply Last reply Oct 31, 2020, 12:21 AM Reply Quote 1
            • A
              Alan Kilborn @M Andre Z Eckenrode
              last edited by Oct 31, 2020, 12:21 AM

              @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 1 Reply Last reply Oct 31, 2020, 1:40 AM Reply Quote 2
              • M
                M Andre Z Eckenrode @Alan Kilborn
                last edited by Oct 31, 2020, 1:40 AM

                @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
                • M
                  Michelle Fernandes @M Andre Z Eckenrode
                  last edited by Nov 2, 2020, 2:12 PM

                  @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
                  3 out of 8
                  • First post
                    3/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors