if match headline then capture headline in variable else if empty line then print empty line else print captured headline + current line