Copy link to clipboard
Copied
Hello,
I have a document that is structured in the following way:
A0. Item A0 text.... ending with a period.
A1. Item A1 text.... ending with a period.
B1. etc.
...
In parts of this document, the item's paragraph has a return within it such that the following occurs:
C933. Item C933 text... \r
text continues as new paragraph (break may occur between words, numbers, following puncuation, etc.).
C934. Item C934 text... .
C935. etc.
I am trying to figure out a GREP script that will remove any return within an item's paragraph. The GREP script would ensure that if a period followed by a return, followed by any sequence of 1 letter and 1 or more numbers followed by a period as seen here:
C934. Item C934 text... .\r
C935. etc.
would be maintained; however, if the following occurs
C933. Item C933 text... \r
continues as new paragraph.
C934. Item C934 text... .
the script would remove the return such that the above would appear as follows:
C933. Item C933 text continues in same paragraph.
C934. Item C934 text... .
Thank you very much for any help you may be able to provide.
Find: (^\D\d+\.\h).+\K\r(?!(?1))
Replace by a simple common space
(^/) The Jedi
Copy link to clipboard
Copied
Find: (^\D\d+\.\h).+\K\r(?!(?1))
Replace by a simple common space
(^/) The Jedi
Copy link to clipboard
Copied
Thank you FRIdNGE for your help - this was the answer!