What type of document are we talking about here ? .rtf, .docx, .html ?
For instance in Word 2010 (not sure about LibreOffice), you can search for the line break character, followed by a paragraph end character. Because I believe that's what the underlying problem is.
For a batch replace you could even use the search and replace feature (use with caution, though).