How to merge 2 separate lines into 1 line for a numerous amount of data?
-
Text:
red, blue, green, orange
,black
red, blue, green, orange
,black
red, blue, green, orange
,blackWhat I need:
red, blue, green, orange, black
red, blue, green, orange, black
red, blue, green, orange, black -
Find:
(?-s)^(.+)\R(.)
Repl:${1}${2}
Search mode: Regular expression -
@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
,
andblack
, where there was none before (though not sure if that was just a typo), so slight adjustment:FIND:
(?-s)^(.+)\R,(.)
REPLACE:${1}, ${2}
-
@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…
-
@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. :-)
-
@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).
-
@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.
-
@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.