Wildcard Carriage Returns
March 12, 2003 – 12:00 pmI’ve occasionally mentioned this in passing, but based on recent questions from readers, it seems worth making a fuss about: Yes, you *can* use a carriage return in a wildcard search.
People who use Microsoft Word often get stymied by this. They try doing a wildcard search with a string like this one:
^pSee(*)^p
What do they get? An error message: “^p is not a valid special character for the Find What box or is not supported when the Use Wildcards check box is selected.”
Then they give up: “Dang! Guess I can’t look for carriage returns in a wildcard search.” In the immortal words of Winston Churchill, “Never, never, never give up.” There’s almost always a solution if you’ll just hang in there and look for it. In this case, the solution is to use the ASCII character code for a carriage return. That code is:
^013
So our theoretical wildcard search would look like this:
^013See(*)^013
And that will work–unless you’re using a Macintosh. On a Mac, Word simply won’t find anything or (as just happened to me when I was testing this) your computer will lock up. But, surprisingly, there is a solution, which took a considerable amount of messing around to figure out. Use the ^013 but “escape” it with a backslash and treat it as a range with square brackets. In other words, use this:
[\^013]
If you’re a Mac user, you know what a breakthrough that is.
Finally, a caution: If you’re *replacing* with carriage returns, don’t use the ASCII code. Instead, use the good old paragraph code, ^p. Why? Because ^013 and ^p are not the same thing. ^p is a Word carriage return, and as such it holds formatting information that ^013 doesn’t. If you replace with ^013, that formatting may be lost.
Want to know more about wildcard searching? See David Varner’s comment and my response in today’s Readers Write column.
_________________________________________
READERS WRITE
David Varner wrote:
“I wanted to bring up your mention of wildcard searching as a skill. You said it ‘may be the most important tool you can acquire.’ Okay, I’ve read all your articles and tried the different tips. Heck, I’ve printed out all the articles. But it’s not the same as having one dedicated wildcard text source. And so the question is, any chance you can point me to (or create/compile) a clear and straightforward, whole enchilada wildcard search and replace manual? Or maybe I could just cut and paste all your wildcard Editorium Updates together!”
I responded to David that I’d already done this, in a document named “Advanced Find and Replace in Microsoft Word.” I sent the document to him, and I’m making it available as a free download for anyone else who wants it. This document is worth your time, believe me. You can start the download by clicking here:
http://www.editorium.com/ftp/AdvancedFind.zip
I’d like to thank Bob Janes for formatting and editing the document and especially for compiling the reference section at the end.
___________________________
After reading my philosophical ramblings on the value of technical literacy in last week’s newsletter, Dan A. Wilson sent this terrific comment. Thanks, Dan!
“In business talks and seminars aimed at corporate climbers and white-collar execs in the past several years, I’ve begun including this phrase at opportune times:
“‘Time was, and not too long ago, that the value of an individual to an organization increased geometrically when he or she became computer-literate. Today, literacy at the computer no longer pulls much weight: you have to be computer-sophisticated today, and that means simply that you must have come to regard the computer as far and away your most valuable tool, your ultimate enabler, your brain’s second-in command. A brain with a pencil in its hand cannot compete–indeed cannot even credibly challenge–a brain with a computer and computer-sophistication at its disposal. Regarding the machine as an enemy, an obstacle, an unnecessary complication is lethal, and the individual who has that view of the computer is at least dying, if not already dead, in the world of business affairs, but probably doesn’t yet know it.’”
___________________________
In the February 26 newsletter, I asked readers to send in their hyphenation exception dictionaries to share with the rest of the world. Rebecca Evans (evansreb@earthlink.net) actually did! Thanks, Rebecca! The dictionary is available for download here:
http://www.editorium.com/ftp/Exceptionary.zip
Here are Rebecca’s comments on the dictionary:
“This is the hyphenation exception dictionary I currently use with Ventura. Ventura lets me specify how many letters must appear before a hyphen at the beginning of a word and how many after at the end so some of the words show hyphenation points at places I would not actually allow.
“In Ventura, words in the exception dictionary shown without hyphenation points are words that Ventura is told not to hyphenate at all. I use this for words that hyphenate differently depending on usage, such as pro-ject and proj-ect. I also place unhyphenated words in here to prevent unfortunate breaks, such as anal-ist.
“The words in this exception list also don’t include every possible hyphenation point because I use this list to force preferred hyphenation, such as dem-onstrate instead of demon-strate.
“Microsoft Word and Ventura mis-hyphenate differently, I would imagine, so many of these words may hyphenate properly in Word. In fact, I’ve been using this list for so long now (so many versions of Ventura) that many of these may actually hyphenate properly in Ventura.”
___________________________
Hilary Powers sent in a terrific macro for working with serial commas. Thanks, Hilary! Here are her comments, followed by the macro:
“Remember I asked awhile back about automating the placement of serial commas? This doesn’t do the whole job, but it takes a lot of the curse off of the problem of dealing with an AP author who’s writing for a Chicago publisher.
“It goes to the next instance of the word ‘and,’ backs up a space, and puts in a comma–ignoring ‘And’ and ‘andiron’ and the like. (I may do a partner for ‘or’ one day, but that doesn’t come up nearly as often.)
“I have it assigned to the hot key Alt-/ and to a voice macro pronounced ’seer-comm.’ So when I’m reading along and I see a spot that needs a serial comma coming up, I just say or key the command and the comma appears where it belongs, without the need to mouse to the exact spot. And if there was another ‘and’ in the way that I missed seeing, well, that’s what Ctrl-Z is for.”
‘MACRO STARTS HERE
‘Serial Macro
‘Macro written 02/27/03 by Hilary Powers
‘
Selection.Find.ClearFormatting
With Selection.Find
.text = ” and”
.MatchCase = True
.MatchWholeWord = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText text:=”,”
‘MACRO ENDS HERE
If you don’t know how to use macros like that one, you can learn how here:
http://www.topica.com/lists/editorium/read/message.html?mid=1706922855
_________________________________________
RESOURCES
Steve Hudson is making his consulting and training services and Microsoft Word spellbooks and macro packages available at his new Web site, here:
http://www.geocities.com/word_heretic/products.html
Check it out! A great way to improve your technical literacy.
_____________________________________________________
THE FINE PRINT
Editorium Update (ISSN 1534-1283) is published by:
The EDITORIUM, LLC
Microsoft Word Add-Ins for Publishing Professionals
http://www.editorium.com
Copyright © 2008 by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.
You may forward copies of Editorium Update to yourself and others (but not charge for it) and print or store it for your own use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is prohibited. Send reprint requests to reprints [at symbol] editorium.com
Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user assumes the entire risk as to the accuracy and use of this document.
The Editorium is not affiliated with Microsoft Corporation.
_____________________________________________________
HOW TO SUBSCRIBE OR UNSUBSCRIBE
To subscribe, send a blank email message to editorium-subscribe [at symbol] topica.com.
To unsubscribe, send a blank email message to editorium-unsubscribe [at symbol] topica.com.
We do not sell, rent, or give our subscriber list to anyone.
____________________________________________________
You must be logged in to post a comment.