I have a text file like this:
Line text,line text
next line
3rd line
Line x
where 2nd and 3rd, etc lines begin with a single space. I need to concatenate all lines prefixed with a space to the previous one without a space, so that the result looks like this:
Line text,line text next line 3rd line
Line x
The lengths of the lines can vary, and there can be many blocks like this. Can I re-format the entire file with a single command?