Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2018, 11:33 AM
GreenBoy GreenBoy is offline Find / Replace hard Carriage Return with Line break. Windows 7 32bit Find / Replace hard Carriage Return with Line break. Office 2010 32bit
Novice
Find / Replace hard Carriage Return with Line break.
 
Join Date: Jun 2014
Posts: 19
GreenBoy is on a distinguished road
Question Find / Replace hard Carriage Return with Line break.

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
Reply With Quote
  #2  
Old 03-10-2018, 09:28 PM
gmayor's Avatar
gmayor gmayor is offline Find / Replace hard Carriage Return with Line break. Windows 10 Find / Replace hard Carriage Return with Line break. Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 03-11-2018, 02:32 AM
GreenBoy GreenBoy is offline Find / Replace hard Carriage Return with Line break. Windows 7 32bit Find / Replace hard Carriage Return with Line break. Office 2010 32bit
Novice
Find / Replace hard Carriage Return with Line break.
 
Join Date: Jun 2014
Posts: 19
GreenBoy is on a distinguished road
Default

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
Reply With Quote
Reply

Tags
find, replace

Thread Tools
Display Modes


Similar Threads
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
Find / Replace hard Carriage Return with Line break. Bad view when using Find and Find & Replace - Word places found string on top line 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft