Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2014, 03:39 PM
H28Sailor H28Sailor is offline search and replace a field containing text and numbers Windows 7 32bit search and replace a field containing text and numbers Office 2007
Advanced Beginner
search and replace a field containing text and numbers
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default search and replace a field containing text and numbers

Hi



I have a field that contains text and numbers
e.g. abc123

I wish to search for this field and replace the contents with 'abc123'

the numeric part may be 1, 2, 3, or 4 digits

can this be done?

Bob M
Reply With Quote
  #2  
Old 09-10-2014, 05:10 PM
Charles Kenyon Charles Kenyon is offline search and replace a field containing text and numbers Windows 7 64bit search and replace a field containing text and numbers Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,138
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I do not believe this can be done using search and replace. It could be done with a macro that finds and examines fields. Those that have a value matching your criteria should be unlinked (converted to their values).

At least that is how I would approach it.
Reply With Quote
  #3  
Old 09-10-2014, 07:48 PM
macropod's Avatar
macropod macropod is offline search and replace a field containing text and numbers Windows 7 64bit search and replace a field containing text and numbers Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What kind of field? Charles' reply concerns fields created via field codes, such as formfields, cross-references, tables of contents, hyperlinks, etc., but perhaps that's not what you mean.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 09-10-2014, 08:45 PM
H28Sailor H28Sailor is offline search and replace a field containing text and numbers Windows 7 32bit search and replace a field containing text and numbers Office 2007
Advanced Beginner
search and replace a field containing text and numbers
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default

The field is formatted as general in excel where the data is inputted.

The spreadsheet is then saved as a .csv file and opened in word

Here I do some search and replace work - mostly adding quote marks around various nominal fields

Bob M
Reply With Quote
  #5  
Old 09-10-2014, 09:43 PM
macropod's Avatar
macropod macropod is offline search and replace a field containing text and numbers Windows 7 64bit search and replace a field containing text and numbers Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So, what you're calling fields has nothing to do with Word's field codes. Rather, you seem to be referring to what in Excel would have been separate columns, but is now just text with commas separating the different elements.

In that case a wildcard Find/Replace can do what you're after, where:
Find = <abc[0-9]{1,4}>
Replace = abc123
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 09-11-2014, 12:51 AM
H28Sailor H28Sailor is offline search and replace a field containing text and numbers Windows 7 32bit search and replace a field containing text and numbers Office 2007
Advanced Beginner
search and replace a field containing text and numbers
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default

Hi Paul

I understand your suggested find but NOT the replace

I wish to take abc123 and create 'abc123' or take def4032 and create 'def4032'

Bob M
Reply With Quote
  #7  
Old 09-11-2014, 01:00 AM
macropod's Avatar
macropod macropod is offline search and replace a field containing text and numbers Windows 7 64bit search and replace a field containing text and numbers Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your original post suggested to me that you wanted to replace abc followed by any number with abc123.
If you want to replace any multi-letter sequence that precedes a multi-digit sequence, you could use:
Find = <[A-Za-z]{1,}[0-9]{1,}>
Replace = '^&'
to insert the single-quote characters either side
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
search and replace a field containing text and numbers Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
how to search and replace BOLD text >> font color change? dylansmith Word 4 03-12-2013 09:51 PM
search and replace a field containing text and numbers Replace all occurrences of one merge field with plain text blankenthorst Mail Merge 5 07-01-2011 05:18 AM
Find and replace page numbers in body of text tollanarama Word 3 02-13-2011 06:00 AM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:19 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