Here is another awk option:
awk '{ORS=(/Love/?FS:RS)}1' file This is some text Love this or that He is running like a rabbi
This will change the template based ORS
Here are some other awk
awk '{printf "%s%s",$0,(/Love/?FS:RS)}' file This is some text Love this or that He is running like a rabbit
If the string Love uses FS as a delimiter, use RS
This should work too, but use the first one.
awk '{printf "%s"(/Love/?FS:RS),$0}' file
Jotne
source share