These appear to all be paragraph breaks.
You could add an arbitrary string like xmxmxmx where there should really be a paragraph break.
Then replace ^p with a space. Then replace xmxmxmx with ^p.
Remove line breaks keeping paragraph breaks
How do I remove line breaks but keep Para 1 and Para 2 whole.
5 answers
Sort by: Most helpful
-
Charles Kenyon 2,956 Reputation points
2022-06-22T22:17:52.717+00:00 -
Paul Edstein 571 Reputation points
2022-06-22T23:59:29.233+00:00 See: https://www.msofficeforums.com/word/29880-cleaning-text-pasted-websites-mails-pdfs-etc.html
Before running the macro there, though, you would need to ensure there are two paragraph breaks separating each of your real paragraphs.What your text has is a paragraph break at the end of every line, not a line break. So, unless you can insert a paragraph break wherever their is supposed to be one, there is no reliable solution. To get you started though, you might do a wildcard Find/Replace, where:
Find = ([.\?\!:;]^13)([A-Z0-9])
Replace = \1^p\2
This will create two paragraph breaks between every line that ends with a sentence termination (i.e. .?!:;) and the next character is a capital letter or number. At worst, this will give you some extraneous paragraphs that you can manually clean up after the macro has run. Since heading also typically lack terminating punctuation, you might till have to manually insert paragraph breaks after them, too. -
Marvest 1 Reputation point
2022-06-22T23:02:39.997+00:00 That works. But is there a way to do it in one shot? It's a long script that was scanned and converted to plain text and has all these paragraph breaks.
-
Marvest 1 Reputation point
2022-06-23T01:28:49.653+00:00 Thanks for the macro. My actual text though doesn't have two paragraph breaks separating each of my real paragraphs. It has only one. Any ideas?
-
Marvest 1 Reputation point
2022-06-23T14:26:41.553+00:00 Thanks. The actual text doesn't have the words "para". I used it just for illustration purposes. A pattern it has is that new paragraphs start with a capital letter. How can we do a Find/Search using that pattern.