Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2014, 11:43 PM
NobodysPerfect NobodysPerfect is offline Tricky wildcard search Windows 7 64bit Tricky wildcard search Office 2010 32bit
Competent Performer
Tricky wildcard search
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Tricky wildcard search

Hi,



I just read Paul's answer to a wildcard Seach & Replace issue https://www.msofficeforums.com/word-...ve-spaces.html, which led me to one of my 'Search & Replace using wildcards' questions.

I need to find a "*" within a string (possible) followed by any charcater or digit (possible) within table cells (table cell marker as 'delimiter'). The string after the "*" has to be deleted (replace "*", possible ).

The problem is not the first part of the pattern, but the restriction to a table cell. I tried '^7' as well as 'Chr(7)', but both don't work.

Right now I'm using a VBA procedure, but simple Search & Replace would be much better - in this specific case.

Thanks
NP
Reply With Quote
  #2  
Old 03-14-2014, 12:06 AM
macropod's Avatar
macropod macropod is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search 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

There is no wildcard expression that limits itself to what is in a table; indeed, you can't even use ^13 for something that depends on a terminating paragraph break if what you're after could be attached to the end-of-cell marker.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-14-2014, 04:43 AM
eNGiNe eNGiNe is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Any chance of restricting the search/replace to a table cell style?
Reply With Quote
  #4  
Old 03-14-2014, 07:07 AM
NobodysPerfect NobodysPerfect is offline Tricky wildcard search Windows 7 64bit Tricky wildcard search Office 2010 32bit
Competent Performer
Tricky wildcard search
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

Hi,

I don't see how a style could help? The problem still remains the same: the search has to find the part of the string after "*" until the end of the cell and replace/delete it with "*". And this has to happen within all tables/cells within the doc.

Would be great if there were a solution without VBA, but ...

NP
Reply With Quote
  #5  
Old 03-14-2014, 10:56 AM
macropod's Avatar
macropod macropod is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search 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

Quote:
Originally Posted by eNGiNe View Post
Any chance of restricting the search/replace to a table cell style?
No, because table styles don't apply to the table content, which will still be in the Normal Style, for example. Table Styles only apply to the table's shading/borders, etc.

Quote:
Originally Posted by NobodysPerfect View Post
I don't see how a style could help? The problem still remains the same: the search has to find the part of the string after "*" until the end of the cell and replace/delete it with "*". And this has to happen within all tables/cells within the doc.

Would be great if there were a solution without VBA, but ...
This can only be done with VBA.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 03-17-2014, 12:05 AM
eNGiNe eNGiNe is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
No, because table styles don't apply to the table content, which will still be in the Normal Style, for example. Table Styles only apply to the table's shading/borders, etc.
I meant, text styles such as tableHead, table Cell, tableCaption applied to the content of the table. Sorry for the terminology glitch!
Reply With Quote
  #7  
Old 03-17-2014, 12:11 AM
macropod's Avatar
macropod macropod is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search 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

Presumably they're custom paragraph/character Styles, as they're not built-in Styles. Any Find, wildcard or otherwise, can be limited to any paragraph/character Style.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 03-18-2014, 12:39 AM
eNGiNe eNGiNe is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Just to check my assumptions, I prepared this simple example. The paragraphs use my standard body text style, the table cells use :ttx for table content. This does at least get me as far as being able to find * only inside a table cell; so if I knew how to use \*.* in a Word regex, I'd hope this would do the trick cell by cell.

Let me know! this would be a useful trick to have up my sleeve.
Reply With Quote
  #9  
Old 03-18-2014, 01:20 AM
macropod's Avatar
macropod macropod is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search 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

Clear as mud! Perhaps you could attach a document to a post showing what you mean?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 03-19-2014, 01:46 AM
eNGiNe eNGiNe is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Yes, it would be easier with the attachments, wouldn't it …
  • first graphic – not referring to a style in the search means I can skip happily through every single * in the file
  • second graphic – restricting my search to style :ttx only picks up the * in paragraphs with the specified style
So if I knew how to say search for a real asterisk and anything after it, in content with the style :ttx applied then I could delete what I'd found; or even chunk the search and delete just the text after the * – but I don't speak Word regex
Attached Images
File Type: jpg searchNoStyles.jpg (112.3 KB, 21 views)
File Type: png searchWithStyles.png (121.6 KB, 21 views)
Reply With Quote
  #11  
Old 03-19-2014, 04:29 AM
macropod's Avatar
macropod macropod is offline Tricky wildcard search Windows 7 32bit Tricky wildcard search 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

Finding a paragraph with an asterisk (or, preferably, any other character - asterisks are harder to work with) isn't at all hard but that's not the same as restricting Find operations to table content, which is what NobodysPerfect is after. The problem with tables, though, is that you can't do any Find that involves a final paragraph break that also works with end-of-cell markers - or even with end-of-cell markers.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tricky wildcard search Tricky bookmark and bullet question skroser Word 1 07-09-2013 08:28 AM
Tricky IF formula twolfend Excel 1 12-05-2011 09:02 AM
Tricky wildcard search Tricky Word problems Eva Word 3 10-14-2011 03:18 AM
Wildcard Problem with Emailadresses Fmax Word 1 06-17-2010 06:09 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

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