What have you tried so far? It seems to me the logic would work something like this:
read a line into an array, store it
read the next line into an array
if it only has one field preceded by whitespace
append that field to the second field of the previous array
print out the stored array
put this array into storage
at the end, print the stored array
Coding that should be fairly simple. I don't know if the third line with only the first field is significant, so you may need to add some code to handle that too.
Available for small or large Perl jobs; see my home node.