Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2015, 06:36 AM
Natedogg Natedogg is offline Find and Replace - How to insert brackets around all numbers in a doc Windows 7 64bit Find and Replace - How to insert brackets around all numbers in a doc Office 2010 64bit
Novice
Find and Replace - How to insert brackets around all numbers in a doc
 
Join Date: May 2015
Posts: 2
Natedogg is on a distinguished road
Default Find and Replace - How to insert brackets around all numbers in a doc

Hi, simple question for the right person: I've got a 350 page document which for work I have to insert [square brackets] around certain numbers throughout the doc.



The doc is mostly text, but there are references to section numbers like "see Section 3.1" and "see Section 10.13" etc throughout - I need to change them all so they read "see Section [3.1]" and "see Section [10.13]".

There are hundreds of these references so it isn't practical to edit one by one. I've done lots of research on wildcards for find and replace, so I have no problem finding these references <(Section )*(.)*> but can't work out how to do a single find-replace to insert the [ ] around all sorts of different numbers, without changing the numbers.

This is literally (ok not literally) killing me, spent hours on it so far. Please help!!
Reply With Quote
  #2  
Old 05-21-2015, 07:05 AM
Natedogg Natedogg is offline Find and Replace - How to insert brackets around all numbers in a doc Windows 7 64bit Find and Replace - How to insert brackets around all numbers in a doc Office 2010 64bit
Novice
Find and Replace - How to insert brackets around all numbers in a doc
 
Join Date: May 2015
Posts: 2
Natedogg is on a distinguished road
Default

Solved my own problem and thought I'd post it in case it helps:

Find: <(Section )(*).(*)>

Replace: \1[\2.\3]
Reply With Quote
  #3  
Old 05-21-2015, 07:16 AM
gmayor's Avatar
gmayor gmayor is offline Find and Replace - How to insert brackets around all numbers in a doc Windows 7 64bit Find and Replace - How to insert brackets around all numbers in a doc Office 2010 32bit
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

The wildcard '*' is a blunt instrument and should be treated with caution ... and you only need two pairs of brackets in the search string. I would have suggested

(Section )([0-9.]{3,})
replace with
\1[\2]

See 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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace BETWEEN numbers WordUser2015 Word 4 12-19-2014 02:09 PM
find and replace consecutive numbers kpl_39 Word 1 06-07-2013 05:04 AM
Find and Replace - How to insert brackets around all numbers in a doc Find/Replace Brackets Problem fatso Word 2 08-04-2011 11:34 AM
Find and Replace - How to insert brackets around all numbers in a doc Find & Replace formula for numbers? Griff Word 4 04-18-2011 02:47 AM
Find & Replace Insert Issue mipacker Word 0 02-18-2009 08:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:27 PM.


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