Remove line breaks keeping paragraph breaks

Marvest 1 Reputation point
2022-06-22T22:07:57.227+00:00

How do I remove line breaks but keep Para 1 and Para 2 whole.

214062-sample-line-breaks.png

Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
950 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Charles Kenyon 2,956 Reputation points
    2022-06-22T22:17:52.717+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  2. 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.

    1 person found this answer helpful.

  3. 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.

    0 comments No comments

  4. 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?


  5. 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.