![]() |
|
#1
|
|||
|
|||
![]()
Replacing carriage return with line return in specific string
I have a large document with a number of clauses which start Clause XX (carriage return) Title of Clause And I want it replaced with Clause XX (Line return) Title of Clause where XX is the number of the clause - currently running from 1 to 130 but can vary in different documents What i have tried so far is using the replace command, selecting more \nd ticking use wild cards. I have then used the following which i thought would work Find What: Article ([0-9])(^13) Replace with: \1 (^10) Where I believe ^13 is Carriage return and ^10 is Line break. The reason for doing this is that I want to reformat all there Clause Titles as Style Heading 2 so I can use them in a Table of Contents with both Parts appearing as one entry as opposed to two separate entries because of the Carriage Returns... NOTE: it is important that the Article XX is followed by a Carriage return (or space and Carriage Return) because the Clauses are also refereed to within the text, and I dont want to replace them. Any assistance in getting this to work most welcome. PS: sorry but I dont want to do this with a macro. Thanks GreenBoy Last edited by Charles Kenyon; 03-11-2018 at 07:27 AM. Reason: Mark as solved |
#2
|
||||
|
||||
![]()
Find
(Clause [0-9]{1,})^13 Replace with \1^11 not \1 (^10) with the wildcard option set http://www.gmayor.com/replace_using_wildcards.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
![]()
Thank you Graham - this works like a charm.
Also thanks for the link to your page. One follow-up question if I may, it turns out the document I have isnt consistent on the Article titles and has between zero and 2 spaces after the article number and the Paragraph mark. eg: Article 1^13 Article 2 ^13 Article 3 ^13 Is there a way to remove these as well? I probably should be able to solve this, but after a night up wrestling with the rest of the document its a little beyond me at the moment. Thanks again GreenBoy |
![]() |
Tags |
find, replace |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
carriage return on PPT | yangthomson | PowerPoint | 0 | 04-21-2016 07:16 PM |
Adding a carriage return at end of each line, and then a blank space, after text entry complete | CEMurphy4 | Word VBA | 1 | 12-02-2015 11:53 PM |
![]() |
paulkaye | Word | 4 | 12-06-2011 11:05 PM |
paragaph hard break, soft break and ...strange break | czomberzdaniela | Word | 2 | 12-03-2010 06:58 PM |
Carriage Return Help | UCHelp | Word | 1 | 04-04-2010 10:11 PM |