Continuation lines to be glued back to original line

I am parsing a log with this format:

06:36:12.230 [TASK1] details here
06:36:12.250 [TASK1] details here
06:36:12.260 [TASK1] details here
continuation here
06:36:12.360 [TASK1] details here

As you can see, some detail info contains one or more "\n" and it breaks my line-oriented parsing.

I need to get those continuation lines to be slapped back to its original line, like here:

06:36:12.230 [TASK1] details here
06:36:12.250 [TASK1] details here
06:36:12.260 [TASK1] details here continuation here
06:36:12.360 [TASK1] details here

I think there is a way to tell awk to use [0-9][0-9]:[0-9][0-9]:[0-9][0-9] as a line separator RS, but not sure how to do it. Any pointers would be appreciated.

I am on Ubuntu 8, my awk is:

 awk -W version
 mawk 1.3.3 Nov 1996 
awk '$0 ~ d {if (e) print e; if (NR>1 && !e) print ""; printf $0; e=""} $0 !~ d {e=e " " $0} END {print e}' d="^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" infile
2 Likes

Great, works exactly as expected.

Under the assumption there's not too many (i.e. two or more) colons in the continuation line, try

awk -F: 'NF>2 && NR>1 {printf RS} END {printf RS} 1' ORS=" " file