Below you find two solutions based on awk and sed. Both solutions are generic, meaning that we do not know how many records/lines are placed between two time strings recognized with regex /..:..:../:
awk :
awk 'BEGIN{ORS=OFS}/..:..:../&&(NR!=1){printf "\n"}1;END{printf "\n"}' <file>
Here we set the Output Record Separator (ORS) equal to the output field separator (OFS). This implies that by default, everything will end up on a single line. However, everytime we find a record which represents a time-string, we print a newline character.
It essentially checks if the line is a time, if so, print a newline character. For the rest it print all records in a single line (ORS=OFS :: output record separator is output field separator).
Remark: the END{printf "\n"} just prints the final newline character and is not really necessary. It depends on your requirements.
sed :
sed ':a;N;/..:..:..$/{P;D};s/\n/ /;ba' <file>
Understanding this is just pure sed wtf. The way to understand this is best done step by step:
:a create a label a
N append the new line to the pattern buffer
/..:..:..$/{P;D} if the pattern buffer ends with a time-string, then print the pattern buffer upto the first new-line character (P) and then delete that same part (D).
s/\n/ / replace the new-line character in the pattern buffer with a space.
ba goto label a
Since sed is invoked without -n it will, by default, print the remaining pattern buffer upon exit.
prinstead ofawk... also, see stackoverflow.com/help/how-to-ask .. for ex:Search, and research ...and keep track of what you find. Even if you don't find a useful answer elsewhere on the site, including links to related questions that haven't helped can help others in understanding how your question is different from the rest.