I have the following output:
02:01:31
OFFLINE
02:02:31
ONLINE
and I would like it to become:
02:01:31 OFFLINE
02:02:31 ONLINE
I found a way of removing all newline / line breaks with sed ':a;N;$!ba;s/\n/ /g'
however it gives me what follows which is not really what I'm after:
02:01:31 OFFLINE 02:02:31 ONLINE
Q: How can I remove newline / line breaks only for lines that match a certain pattern (in this case [0-9]
would be enough?
PS: It doesn't have to be with sed
as long as I can apply a regex pattern to the matching of lines