Hi all,
I'm trying to join sentences in a document, but some of the sentences have been split apart with an empty line in between. For example:
The dog chased after a ball
that was thrown by its owner.
The ball travelled quite far.
to:
The dog chased after a ball that was thrown by its owner.
The ball travelled quite far.
I was thinking I could search for an empty line and then the beginning of the next line for a lower case character. It copies that line, removes it and the empty line above it, and then appends the copied sentence to the other broken sentence (sorry for the confusion).
I'm new to sed and tried it with this command:
sed "/$/{:a;N;s/\n\(^[a-z]* .*\)/ \1/;ba}"
But only does it once and only removes the empty line and not appending the 2nd half of the broken sentence to the first part.
Please help.