The Zen of Editing: Tales of the Pen Master

by Jack Lyon

If you’ve ever read much about Zen Buddhism, you’re probably aware of its strange but wonderful stories of masters, monks, and enlightenment. Here is an example:

The Emperor asked Zen Master Gudo, “What happens to a man of enlightenment after death?”

“How should I know?” replied Gudo.

“Because you are a master,” answered the Emperor.

“Yes,” Gudo said, “but not a dead one.”

In that spirit, here are some tales not of the Zen master but rather of the Pen master, whose job is to open the minds of editors everywhere. As is usual in Zen tradition, each story is followed by enlightened commentary.

Following the Precepts

An assistant editor went before the Pen master, saying, “Lo, these many years I have faithfully followed the precepts in Garner's Modern American Usage and The Chicago Manual of Style. Why am I not yet enlightened?”

“Because,” said the master, “you have faithfully followed the precepts in Garner's Modern American Usage and The Chicago Manual of Style.”

In true Zen spirit, this story illustrates the importance of following the rules and not following the rules. Editors have “rules” for an important reason — to make sure that the author’s intended meaning is clearly communicated to readers in a consistent, coherent way. But blindly following the “rules” can also result in miscommunication. That is why, since its initial publication in 1906, The Chicago Manual of Style has included the following disclaimer: “Rules and regulations such as these, in the nature of the case, cannot be endowed with the fixity of rock-ribbed law. They are meant for the average case, and must be applied with a certain degree of elasticity.”

Editing Is More Than Mechanics

One day the Pen master was passing an assistant's cubicle.

“Oh, master,” said the assistant, “I'm so glad you came by. Look at this wonderful new editing software. It flags incomplete sentences, finds dangling modifiers, and much more. With this software, the manuscript practically edits itself!”

“Interesting,” said the master. “How does it know when a paragraph should be deleted?”

Editing is not simply a matter of mechanics; if it were, a computer could do it. Fortunately for editors, a human mind is required. At the Editorium, I create and sell Microsoft Word add-ins to help editors do their work. These add-ins, to some degree, automate parts of the editing process. But in the end, cognitive judgment is needed to decide which parts should be automated and which should not, and if any of the automated parts should in some cases be overridden. In addition, there are many parts of the process that simply cannot be automated. Language is complex and subtle, and something as small as a misplaced comma can literally make the difference between life and death (as in a medical journal).

If It Ain’t Broke, Don’t Fix It

An assistant editor was reading a manuscript that had already been gone over by the Pen master. To her surprise, the manuscript contained not a single correction.

Questioning the master about this, the assistant remarked, “You said you had edited this manuscript, but it contains no corrections at all.”

“Nevertheless,” said the master, “now that I'm finished with it, the manuscript is perfect.”

What if you went completely through a manuscript without making a single correction, because, as far as you could tell, no corrections were needed? Would you have done your job? I believe that you would have. An editor’s job is not to make corrections; an editor’s job is to make sure the writing is clear, and if it is, no corrections are needed. Of course, in real life, that is probably never the case. But it’s an interesting thing to think about.

Something Is Always Broke

An assistant brought a new book, hot off the press, to the Pen master. “Master, look!” she said. “The book is beautiful! The cover is bright and attractive, the marketing copy is appealing, the typography is excellent. Surely this is the finest book we have ever published.”

The master opened the book to a random page. “Read the first line,” he said.

“‘When this matter came to the attention of the pubic …’”

These are the things that haunt our lives. I started my publishing career as a proofreader at a university press. On prominent display in our office was a book on whose cover the title had been misspelled — a reminder of the need for constant vigilance on every part of the book during every part of the publishing process. At a later job, thousands of copies of a publication ended up being shredded because of a photograph that should not have been included. So pay attention! As a famous Zen story (a real one) teaches:

A student said to Master Ichu, “Please write for me something of great wisdom.”

Master Ichu picked up his brush and wrote one word: “Attention.”

The student said, “Is that all?”

The master wrote, “Attention. Attention.”

The student became irritable. “That doesn't seem profound or subtle to me.”

In response, Master Ichu wrote simply, “Attention. Attention. Attention.”

In frustration, the student demanded, “What does this word attention mean?”

Master Ichu replied, “Attention means attention.”

(Charlotte Joko Beck, Nothing Special: Living Zen. [New York: HarperCollins, 1993], 168.)

Editing Reveals Meaning

After receiving his edited manuscript for review, the author was furious. “How dare you!” he said to the Pen master. “This manuscript is covered with corrections.”

“You must not look at the corrections,” said the master. “You must look at the meaning behind the corrections.”

Here we have the opposite case from the one above, where nearly everything needs fixing. Again, however, the process is not about correcting “errors”; the process is about making sure that the author is clear — and not just to the reader. An editor is not out of place to say to an author, “You seem to be saying this, but what I think you really mean is this. Is that right?” It’s all about meaning.

It is not the editor’s place, however, to add meaning, to “improve” the author’s ideas. Editors who feel the need to do so should write their own books.

Context Matters

An editor and a designer were arguing about which was more important, layout or words.

“The layout is finished,” said the designer. “You'll need to edit the wording to fit.”

“The editing is finished,” said the editor. “You'll need to change the design to accommodate.”

Finally, they took their argument before the Pen master, who looked at them severely. “What matters is neither the design nor the words,” he said. “What matters is the meaning.”

“And how does one know the meaning?” asked the editor.

“By looking at the design and the words.”

And this is what makes publishing so interesting — and so difficult. The meaning of a word or a sentence or a paragraph always depends on what’s going on around it. Ideas are not fixed; as we change the words or design of a publication, meanings change too, so we must be constantly on our guard.

A student once asked Zen master Shunryu Suzuki, “Can you reduce Buddhism to one phrase?” His reply was spontaneous and profound: “Everything changes.” (David Chadwick, Crooked Cucumber: The Life and Zen Teachings of Shunryu Suzuki [New York: Broadway Books, 1999], xii.)

Here’s another of my Pen Master stories that illustrates the same principle:

One day an assistant came to the Pen master for help with an awkward sentence.

“No matter what I do, I can't seem to fix this sentence,” he said. “If I delete a word, the sentence no longer makes sense. If I add a word, the sentence seems bloated.”

“If fixing the sentence doesn't fix it,” the master replied, “perhaps it doesn't need fixing.”

The next day, the assistant came to the Pen master for help with another awkward sentence.

“Again,” he said, “I can't seem to fix this sentence. If I delete a word, the sentence no longer makes sense. If I add a word, the sentence seems bloated.”

The master picked up his pen and deleted the sentence entirely. “There,” he said. “Now the fixing is fixed.”

The following day, after a sleepless night, the assistant came again to the Pen master.

“The first day, you said the sentence didn't need fixing. The next day, you simply deleted the sentence. How does one know when to fix, when to stet, and when to delete?”

The master looked at him shrewdly. “It doesn't depend on the sentence; it depends on the sentences around it.”

Thinking to outwit the master, the assistant replied, “And what if there are no sentences around it? Then how does one know what to do?”

The master gave a great sigh. “One doesn't,” he said.

Sometimes It Doesn’t Matter

An assistant came to the Pen master for advice about reconciling proofs.

“One proofreader fixes an error one way; another fixes the error another way,” said the assistant. “Which way is right?”

“Neither is right; neither is wrong,” said the master. “What matters is that the error was fixed.”

Editors sometimes argue about the “right” way to fix something. But in the end, it may not matter as long as the meaning is clear. There are other considerations, of course, such as elegance, euphony, and even beauty. But these are in the realm of enlightenment beyond enlightenment.

What Is Perfection?

An author brought her manuscript to the Pen master. “This new book is my masterpiece,” she said. “It needs no editing at all; it is perfect just as it is.”

“Truly the book in your mind is perfect,” said the master. “But this is not the book in your mind.”

The real job of an editor is to capture what an author means to say and convey that meaning intact into the mind of the reader. This, of course, is impossible in reality, but that doesn’t keep us from trying, and sometimes we may come close. As the Zen masters say, “Practice itself is enlightenment.”

Subhuti was Buddha’s disciple. He was able to understand the potency of emptiness, the viewpoint that nothing exists except in its relationship of subjectivity and objectivity.

One day Subhuti, in a mood of sublime emptiness, was sitting under a tree. Flowers began to fall about him.

“We are praising you for your discourse on emptiness,” the gods whispered to him.

“But I have not spoken of emptiness,” said Subhuti.

“You have not spoken of emptiness, we have not heard emptiness,” responded the gods. “This is true emptiness.” And blossoms showered upon Subhuti as rain.

(Paul Reps and Nyogen Senzaki, comps., Zen Flesh, Zen Bones [Boston: Tuttle Publishing, 1985], 53.)

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals, Wildcard Cookbook for Microsoft Word, and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Posted in Contributor Article, Philosophy & Ethics, The Pen Master | Tagged , , , | 9 Responses

Lyonizing Word: Why Computers?

by Jack Lyon

Dan A. Wilson, of The Editor’s Desktop, once advised editors that a computer is “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.”

Why would that be so? After all, even under the guidance of the most brilliant programmer, a computer can’t ensure that a manuscript has accuracy, clarity, or elegance of expression. But a computer can fix hundreds of mechanical problems that editors shouldn’t have to worry about, and it can do it quickly and consistently.

If something can be automated, then automate it! Let the computer do the heavy lifting. Why is that important? Because it enables you to do more work in less time, and it frees your mind to concentrate on the things that a computer can’t handle (like accuracy, clarity, and elegance of expression). If you’re working for a corporation, that makes you more valuable as an employee (making raises more likely and layoffs less likely). If you’re working for yourself, it enables you to earn more money for the time you put in (as long as you’re charging by the job, the word, or the page, which you should be [see, e.g., On the Basics: Dealing with the Perennial Question of Setting Rates for Our Work]).

Editors working on a computer almost always use Microsoft Word. Love it or hate it (I do both), it is unquestionably the de facto word processor in the publishing world. So how can you use Word to automate whatever can be automated? Here are some suggestions:

  1. Learn to use the full power of Word’s find and replace feature, including wildcards. My Wildcard Cookbook for Microsoft Word will teach you everything you need to know. (No brag, just fact, as we used to say in grade school.)
  2. Learn to record and run macros to automate repetitive editing tasks. My Macro Cookbook for Microsoft Word is a good starting place.
  3. Use Microsoft Word add-ins (like the ones I create at The Editorium) that expand Word’s features to automate various editorial tasks. Let’s look at what some of those add-ins can do to ease your workload.

FileCleaner

We’ll start with one of my most popular add-ins, FileCleaner, which cleans up some of the most common problems in electronic manuscripts, including:

  • Multiple spaces in a row
  • Multiple returns in a row
  • Spaces around returns
  • Double hyphens that should be em dashes
  • Hyphens between numbers that should be en dashes

And much, much more. Here’s a screen shot of the options available:

FileCleaner Options

FileCleaner Options

Want to try it? All of those options are included as part of my Editor’s ToolKit Plus 2014 add-in, which I highly recommend that you download and try. The program offers a 45-day trial period so you can make sure it does what you need before deciding to buy. And if you need help using it, I’m always available by email.

I’d like to point out one special feature of FileCleaner that is frequently overlooked. See that option (under “Formatting”) to “standardize font formats (remove overrides)”? It removes all those odd, inconsistent uses of different fonts that authors like to use, but at the same time it leaves italic, bold, superscript, and styles intact. You won’t believe what a difference this can make in cleaning up a manuscript!

FileCleaner also offers to clean up the active document, all open documents, or all documents in a folder, which means you can run the program on a whole batch of files at once while you go back to reviewing manuscripts (or spending time with family and friends).

Document options

Document Options

Remember all of my talk about automating what can be automated? This is what I’m talking about. Instead of manually doing dozens of find-and-replace routines on dozens of documents, let FileCleaner do the work.

MegaReplacer

FileCleaner is great for cleaning up common problems, but what if you have uncommon problems that you need to clean up? What if you need to go through three dozen documents and change millenium to millennium in all of them, along with dozens of other misspellings (manger to manager, rarify to rarefy, and on and on and on)? That’s what MegaReplacer is for. Again, it works on the active document, all open documents, or all documents in a folder. But unlike FileCleaner, it allows you to define your own find-and-replace items and then run them en masse. You start by creating a list of the items you want to find and replace, with the find item on the left and the replace item on the right, separated by a pipe symbol (|), which you’ll probably find under your backspace key. Your list will look something like this:

millenium|millennium
manger|manager
pubic|public

Save the list as a Word document, and you can use it over and over again.

So far, so good. But you’re not limited to finding and replacing individual words; you can find and replace whole phrases that you’d ordinarily have to fix manually while editing:

at this point in time|now
alright|all right
an historical|a historical
a large number of|many
a small number of|some

To give you even more flexibility, MegaReplacer allows you to specify Match Case, Whole Words Only, both Match Case and Whole Words Only, or Use Wildcards by appending a code to the items on your list:

“+c” for Match Case
“+w” for Find Whole Words Only
“+&” for Match Case and Find Whole Words Only
“+m” for Use Wildcards

Here’s an example of each:

Department|department+c
per|according to+w
Chief|chief+&
p ([0-9]@.))|p. 1+m

To get you started, MegaReplacer comes with a long list of useful corrections that you can modify to meet your needs.

Editor’s ToolKit

The most basic functions of Editor’s ToolKit Plus reside in the section called “Editor’s ToolKit”:

Editors ToolKit Menu

Editors ToolKit Menu

In particular, they automate some of the most common editorial tasks:

Text Features

Text Features

Furthermore, Editor’s ToolKit assigns these tasks to the function keys on your keyboard. Need to italicize (or romanize) a word? Press F8. Want to transpose two words? Press F11. To lowercase a word, press F10.

Please note that these keyboard assignments are the default setting for Editor’s ToolKit, which Rich Adin has correctly pointed out should not be the case (and will not be the case in the next version of the program). You can easily go back to Word’s original settings, however, by clicking the Editor’s ToolKit Plus icon and then clicking “Clear Keyboard Shortcuts.”

Keyboard Shortcuts

Keyboard Shortcuts

But if you find that you like the Editor’s ToolKit keyboard assignments, you can activate them by clicking “Set Keyboard Shortcuts.” The program download includes a keyboard template that lists the default shortcuts; print it out and place it above your function keys, and you’ll have a handy guide to which key does what (remember WordPerfect 5.1?).

The keyboard shortcuts for Editor’s ToolKit are not arbitrary, by the way. I’ve tried to arrange them so that the most common editorial tasks are right at your fingertips. For example, F7 toggles italic on and off. Yes, CTRL + I does the same thing, but after you’ve used F7 a few times, CTRL + I will seem clunky and annoying. Something that small does make a difference in how easily and smoothly you’re able to work in Word (see Lyonizing Word: The Right Tool for the Job and Lyonizing Word: Assigning Macro Shortcut Keys).

Many other features are available from the keyboard, but my favorite is Cap Title Case. To use it, select the text you want to put in title case and press F9. But doesn’t Microsoft Word already have that feature? Yes, it does. But take this example:

The call of the wild

Microsoft Word will turn it into this:

The Call Of The Wild

Editor’s ToolKit will turn it into this:

The Call of the Wild

In other words, Editor’s ToolKit properly handles common articles and prepositions. (The next version of the program will allow you to specify those you want to use.)

All of these are small things, but in the pressure-cooker of day-to-day editing, small things make a big difference in the ease and even the pleasure with which these tiny tasks can be accomplished. I’ve been a working editor since 1978, so I’ve been doing such tasks a long time. I created these tools (and the many others included with Editor’s ToolKit Plus) so that my computer can handle the boring, repetitive, mechanical tasks, allowing me to do the more enjoyable and important work that a computer, no matter how sophisticated, simply cannot do. That, right there, is the reason for computers.

How do you use your computer to make your work easier and faster? I’d love to hear your ideas.

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals, Wildcard Cookbook for Microsoft Word, and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Looking for a Deal?

You can buy Editor's Toolkit Plus 2014 in a package with EditTools and PerfectIt and at a special savings of $78 off the price if bought individually. To purchase the package at the special deal price, click Editor's Toolkit Ultimate.

Posted in Computers and Software, Contributor Article, Editing Tools, Editorial Matters, Lyonizing Word | Tagged , , , , , | 3 Responses

Lyonizing Word: Secrets of the Ribbon

by Jack Lyon

From the beginning, Microsoft Word used a standard menu interface that looked like this:

Word's Original Menu Interface

Word's Original Menu Interface

Click a menu item, and you’d get a list of more items:

Original Menu Interface Submenus

Original Menu Interface Submenus

Keep clicking, and eventually you’d activate the feature you wanted to use. All of this was straightforward. Then came Microsoft Word 2007, with its “Ribbon” interface:

The Ribbon Interface

The Ribbon Interface

According to Microsoft, the idea was to bring Word’s “most popular commands to the forefront” rather than burying them under a series of menus. For users, this took considerable getting used to, but, mostly, it worked. Unfortunately (and a little ironically), a few of the Ribbon’s features are still less than obvious, which prevents some users from understanding the full power of the features available to them.

Feature 1: Split Buttons

Most of the buttons on the Ribbon interface are just that—buttons. For example, here’s what the NoteStripper button looks like in my Microsoft Word add-in Editor’s ToolKit Plus 2014:

Notestripper Split Button

Notestripper Split Button

If you click that button, either on the pencil-sharpener icon or on the little arrow underneath it, here’s what you’ll get:

The Notestripper Menu

The Notestripper Menu

But now consider the button for FileCleaner, also included with Editor’s ToolKit Plus 2014. At first glance, it looks like the same kind of button used for NoteStripper, with a graphic icon at the top and a tiny arrow at the bottom:

The FileCleaner Button

The FileCleaner Button

Click the arrow, and here’s what you’ll get:

The FileCleaner Menu

The FileCleaner Menu

What many people don’t realize, however, is that the FileCleaner button is a split button. If you hover your cursor over a split button you’ll see a horizontal line splitting the button in two:

Seeing the Split

Seeing the Split

The bottom half, with the arrow, works just as before. But the top part is a different matter. If you click it, you’ll get full access to all of FileCleaner’s batch cleanup options:

FileCleaner Dialog

FileCleaner Dialog

Unfortunately, many people don’t realize that these options exist, which means that they’re missing much of the program’s power. This isn’t my fault, by the way; it’s a result of the way Microsoft designed the Ribbon (although possibly I should use two FileCleaner buttons, one for individual items and one for batch options). At any rate, now that you understand the problem, you can do a bit of exploring, looking for buttons that offer more than at first appears.

Feature 2: Dialog Box Launchers

At the bottom right of many of the groups on the Ribbon is a tiny box with an arrow:

The Tiny Arrow

The Tiny Arrow

Some users overlook these arrows completely, missing some of Word’s most useful features. Microsoft calls these arrows “Dialog Box Launchers,” and if you click one of them, you’ll see more options related to its particular group. Usually these options appear in a dialog box (hence the name) but sometimes in a task pane. For example, if you click the launcher in the “Paragraph” group, you’ll get the dialog box for paragraph formatting:

Launch of the Paragraph Dialog

Launch of the Paragraph Dialog

If you’re now saying “So that’s where that went,” I’m glad I could be of help. Again, it’s worth the effort to systematically explore all of the features that are hidden under these “launchers.”

Feature 3: Contextual Menus

Some of the items on the Ribbon are contextual — that is, they don’t appear until you’re actually working with something for which they’re needed. Tables provide a good example. If your document includes a table, and your cursor is actually in that table, you’ll see the following menu on the Ribbon:

Table Tools

Table Tools

Click it, and you’ll get this:

Table Contextual Menu

Table Contextual Menu

Wow, lots of options! But if you didn’t know about contextual menus, you might miss them. Other contextual menus appear if you’re working with any of the following:

  • Headers or footers
  • Text boxes
  • Graphics
  • Clip art
  • Equations
  • Shapes
  • SmartArt
  • WordArt

There are probably other items that use contextual menus, but those are the most obvious ones that come to mind. Remember, contextual menus show up only when they’re needed, so keep an eye out for them; you’ll be glad you did.

Now that you know some of the secrets of the Ribbon, would you say that Microsoft succeeded in using it to bring Word’s “most popular commands to the forefront”? Or does the Ribbon actually hide more features than it reveals? Perhaps more important, do you like the Ribbon, and if so, how do you use it to work more effectively? What do you think?

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals, Wildcard Cookbook for Microsoft Word, and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Looking for a Deal?

You can buy Editor's Toolkit Plus 2014 in a package with EditTools and PerfectIt and at a special savings of $78 off the price if bought individually. To purchase the package at the special deal price, click Editor's Toolkit Ultimate.

Posted in Computers and Software, Contributor Article, Lyonizing Word | Tagged , , , , , , | 3 Responses

Wildcard Cookbook for Microsoft Word

Wildcard Cookbook for Microsoft Word

If you're editing or writing in Microsoft Word, you need to understand Word’s advanced search features. These features are extremely powerful, but they’re also virtually undocumented; most explanations of their use have been limited to a simple table of wildcards. My new book, Wildcard Cookbook for Microsoft Word, explains in detail how you can use these powerful tools to blaze through repetitive problems that would take hours to correct by hand. It covers:

  • Using Word’s find and replace options (yes, all of them—including the hidden ones).
  • Finding and replacing with Word’s built-in codes (for dashes, page breaks, and much more).
  • Finding and replacing with numeric character codes (ASCII, ANSI, and Unicode—when regular letters and numbers aren't enough).
  • Finding and replacing with wildcards, including wildcard ranges, wildcard groups, and the powerful “Find What Expression” wildcard. (This is the good stuff, the real meat of this book.)

The book explains all aspects of finding and replacing in Microsoft Word, with numerous examples of wildcards used to fix real-world documents, wildcard tips and techniques from readers of Editorium Update newsletter, a reference section for ease of use, and a thorough index.

Although I write and sell Microsoft Word macros for a living, the tools I depend on most are Word's advanced find and replace features. Learning to use these tools takes time and effort, but the payoff is huge. I hope this book will help you use these tools to streamline your work, save time, and make more money!

Daniel Heuman, CEO and founder of Intelligent Editing, sent me the following unsolicited comment:

This. Is. Amazing. What a brilliant, brilliant idea! I've actually been directing people to your wildcard freebie page lately. But this is so much better! The world has needed this book for a while!

Thank you, Daniel! The book is now available at Barnes & Noble, Amazon, and other online retailers.


Resources

Wildcard Cookbook for Microsoft Word is a fairly small (but value-packed) book (114 pages, 5.5 by 8.5 inches). My big book, Microsoft Word for Publishing Professionals (632 pages, 7 by 10 inches) is now available as a free download from Intelligent Editing. All you need to do is sign up for Daniel Heuman's free newsletter, which covers a wide range of topics and provides free tips for authors and editors. I subscribe, and I think you should too. When you do, you'll get Microsoft Word for Publishing Professionals as a hyperlinked, searchable PDF, perfect for easy reference in handling those tough Microsoft Word problems.

Note: The PDF includes a secret special offer right after the front cover. I won't tell you what it is; you'll need to find out for yourself. But I think you'll like it!

Posted in Books, Editing, Microsoft Word, Uncategorized, Wildcards | Comments closed

Lyonizing Word: But Wait—There’s More!

by Jack Lyon

Replacing Basic Text

Searching with wildcards in Microsoft Word can accomplish miracles in editing, but some people find wildcards a little too arcane to deal with. If you’re one of those people, you might benefit from some of Word’s lesser-known but easier-to-use search options. But first, let’s do a basic find and replace. Open Word’s “Find and Replace” dialog by pressing CTRL + H (or click Home > Editing > Replace on Word’s ribbon interface). Then:

  1. In the “Find what” box, enter a word you want to search for. (We’ll use the misspelled “millenium” as an example.)
  2. In the “Replace with” box, enter a word you want to replace the incorrectly spelled “millenium” with. (We’ll use the correctly spelled “millennium” as an example.)
  3. Click the “Replace All” button.
Find & Replace

Find & Replace

That’s it. Every occurrence of “millenium” will be replaced with “millennium.” Simple and quick.

Refining Your Search

But wait—there’s more! Microsoft Word provides many ways to refine your search. See the “More” button at the bottom of the “Replace” dialog?

More Button

More Button

Click it. Here’s what you’ll see:

The "More" Options

The "More" Options

Under “Search Options,” you can specify whether to search up, down, or through all your text:

Search Options

Search Options

You can also match case and find whole words only:

Additional Options

Additional Options

There are actually lots of options, all worth exploring:

Match case

Obviously, this option finds only text that matches the case (capitalized or lowercased) of the text in the “Find what” box. If you enter “Hello” in the “Find what” box with “Match case” checked, Word finds “Hello” but not “hello.” If you enter “hello,” Word finds “hello” but not “Hello.”

Find whole words only

This option finds whole words only. For example, if you search for “sing,” Word finds “sing” but not “singing.” If this option is not checked, Word finds both “sing” and “singing,” as well as “using” and “kissing.”

Use wildcards

This option tells Word that you want to search using wildcards:

Use Wildcards

Use Wildcards

Wildcards are important, but in this article we’re trying to avoid these. For explanations and examples, see my past articles (e.g., Lyonizing Word: From Easy to Impossible — Three Variations on a Theme, Lyonizing Word: The Easy Way, Not So Easy, Lyonizing Word: The Easy Way, Not So Easy, and Lyonizing Word: We Can Do This the Easy Way, or . . . ; if you use EditTools, see The Business of Editing: Wildcarding for Dollars). Please note, however, that if this option is checked, you can no longer select “Match case” or “Find whole words only.” Even so, during a wildcard search, “Match case” is automatically enabled, even though it’s not shown as enabled (an oversight on Microsoft’s part). “Find whole words only,” on the other hand, is inactive.

Sounds like (English)

This option finds words that sound like the word in the “Find what” box. For example, if you search for “cot,” Word also finds “caught.” If you search for “horse,” Word also finds “hoarse.” This could be useful if you’re working on a document in which certain words have been confused or mistyped. Basically, this feature works on words that are homophones; it doesn’t seem to work on words that sound almost alike, such as “horse” and “whores.” On the other hand, while searching for “horse,” it also finds “horsey” but not “horses,” so who knows?

Find all word forms (English)

This option finds what Microsoft calls “all” forms of the word in the “Find what” box. For example, if you search for “sit,” Word also finds “sat” and “sitting.” The word “all” is a little misleading, however. The feature relies on an underlying database of word forms that is pretty good but has some omissions. For example, if you search for “eat,” Word finds “eat, “ate,” “eaten,” and “eating” but not “eater.” Similarly, if you search for “horse,” Word finds “horse,” “horses,” and “horsing” but not “horseless.” It’s a useful feature, mostly for finding verb forms; just don’t expect it to actually find all forms of a word.

Match prefix

This option matches words beginning with the search string. For example, if you put “pre” in the “Find what” box, Word finds “prepare,” “present,” and so on. This isn’t a “smart” feature; it searches for characters only, not word roots. For example, searching for “pre” also finds “prestidigitation” and “pressure,” even though “pre” isn’t really a prefix in those words.

Match suffix

This option matches words ending with the search string. For example, if you put “ing” in the “Find what” box, Word finds “singing,” “typing,” and so on. This isn’t a “smart” feature; it searches for characters only, not word roots. For example, searching for “ing” also finds “boing,” “spring,” and “thing,” even though “ing” isn’t really a suffix in those words.

Ignore punctuation characters

Ignores punctuation characters between words. For example, “trees plants and flowers” finds “trees, plants, and flowers” as well as “trees plants and flowers.” This might be useful for fixing problems with serial commas.

Ignore white-space characters

Ignores all white space (spaces, tabs, and so on) between words. For example, “webpage” finds “web page” as well as “webpage.” This is the inverse of “Find whole words only” and could be useful for fixing words that are sometimes spelled open and sometimes closed.

Other options

If you’re working in a language other than English, other options may be available, including Match Kashida, Match Diacritics, Match Alef Hamza, and Match Control. I know almost nothing about these options, so I can’t comment on them with any degree of expertise.

Format

One of the most important tools in Microsoft Word’s find and replace toolbox is the ability to search for formatting — all kinds of formatting. To do so, click the “Format” button:

Format Button

Format Button

Here’s what you’ll get:

The "Format" Options

The "Format" Options

Each option (such as “Font”) opens the usual dialog for that feature:

Font Format Options

Font Format Options

I won’t go into all of the options in these dialogs as they’re basically the same ones you’d get while formatting any text in Word. “Font” displays font options, “Styles” displays styles, and so on. You can select any of those options and use them as something to find or replace. For example, if your cursor is in the “Find what” box and you select “Italic” in the “Find Font” dialog, here’s what you’ll get:

Displaying the Font Option Choice

Displaying the Font Option Choice

Now Word will find text in italics but not in roman. If you also enter a word, you’ll find that word in italic but not in roman. If you don’t enter a word, you’ll find anything formatted as italic.

But what about the “Replace with” box? What happens if you use formatting there?

If the “Replace with” box includes some text, whatever is found will be replaced by that text in the format you specified. If the “Replace with” box doesn’t include text, whatever is found will be replaced with itself in the format you specified. For example, if you search for the word “apples” to be replaced by “pears” in bold, that’s exactly what you’ll get — “pears” in bold. If you search for the word “apples” to be replaced by bold alone (with no text), you’ll get “apples” in bold.

If, on the other hand, you search for “apples” but don’t specify text or formatting in the “Replace with” box, “apples” will be replaced with nothing; in other words, it will be deleted.

Many variations are possible. Here’s a basic summary:

Find Replace Result
apples pears pears
apples pears [bold] pears [bold]
apples [bold] apples [bold]
apples [nothing] [apples deleted]
[bold] [nothing] [bold text deleted]
[bold] pears [bold text becomes “pears” in bold]
[bold] pears [italic] [bold text becomes “pears” in bold italic]
[bold] [italic] [bold text becomes bold italic]

Note that you can also specify not a certain kind of formatting, such as “not bold” or “not italic” in either find or replace. You can also use combinations of formatting (and “not” formatting). For example, you can search for bold but replace with italic and not bold, which will turn any bold text into italic (but not bold italic) text.

Built-In Codes

In addition to all of those options, Microsoft Word includes lots of built-in find-and-replace codes that are not wildcards (although lots of people call them that). You can use these built-in codes to search for things like paragraph breaks, tabs, section breaks, column breaks, dashes, footnotes, endnotes, graphics, and many other things that aren’t actual text, and codes are a whole lot easier to use than wildcards. In fact, codes should be your default tool; you should use wildcards only when built-in codes won’t do what you need (which is actually fairly often, unfortunately).

Some of Word’s built-in codes can be used only in the “Find what” box; others can be used only in the “Replace with” box. Some of the codes can be used in both boxes.

“Find What” Codes

To see the codes that can be used in the “Find what” box, put your cursor in the box. Now click the “Special” button at the bottom of the “Find and Replace” dialog.

The "Special" Button

The "Special" Button

You’ll get a list like this:

The "Special" Options

The "Special" Options

Identify the item you want to find and click it, for example, “Paragraph Mark.” You’ll get the following code in the “Find what” box (since that’s where your cursor was located):

^p

That tells Word to find a paragraph break — that is, the end of a paragraph.

Each item on the list will insert a different code. For example, here’s the code for an em dash:

^+

And here’s the code for an en dash:

^=

“Replace With” Codes

Now put your cursor in the “Replace with” box and click the “Special” button again. This time, you’ll get a different list:

The Codes

The "Replace with" List

Again, clicking one of the list items will insert a code into the “Replace with” box. For example, if you click “Clipboard Contents” you’ll get this:

^c

That’s an extremely useful code, because ordinarily the “Replace with” box can hold no more than 255 characters. But using the ^c code, you can replace with anything that is currently copied to the Clipboard, which can hold many pages of text, graphics, or anything else.

After you’ve worked with built-in codes for a while, you’ll find it easy to just type them in by hand. In the meantime, you can use the “Special” lists to insert them.

You can also use combinations of codes. For example, you could search for tabs followed by paragraph breaks (^t^p) and replace them with paragraph breaks alone (^p).

Here’s a summary of Word’s built-in codes and where they can be used:

Character or object Find what Replace with
Annotation Mark (comment) ^a
Any character ^?
Any digit ^#
Any letter ^$
Caret character ^^ ^^
Clipboard contents ^c
Column break ^n ^n
“Find what text” (whatever was found during your search) ^&
Em dash ^+ ^+
En dash ^= ^=
Endnote mark ^e
Field ^d
Footnote mark ^f
Graphic ^g
Line break ^l ^l
Manual page break ^m ^m
Nonbreaking hyphen ^~ ^~
Nonbreaking space ^s ^s
Optional hyphen ^- ^-
Paragraph mark ^p ^p
Section break ^b
Tab character ^t ^t
White space ^w

Even without wildcards, Microsoft Word’s find and replace features can do an awful lot — much more than you might think. You probably already knew how to use “Match case” and “Find whole words only,” but did you know about those other options? “Ignore punctuation characters” and “Ignore white-space characters,” for example, can be very useful in editing. Being able to find and replace formatting is essential, especially when using styles. And using Word’s built-in codes lets you search for all kinds of things (graphics, page breaks, dashes, and so on) that would otherwise require more advanced techniques (like wildcards and numeric codes). In other words, Microsoft Word’s basic find and replace features aren’t so basic — at least not in what they can do!

Wildcard Cookbook

This article is a slightly modified excerpt from my new book, Wildcard Cookbook for Microsoft Word, now available at Barnes & Noble, Amazon, and other fine bookstores:

"Wildcard Cookbook" by Jack Lyon

"Wildcard Cookbook" by Jack Lyon

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

 

Posted in Computers and Software, Contributor Article, Editing Tools, Lyonizing Word | Tagged , , , , , | 2 Responses

Lyonizing Word: Assigning Macro Shortcut Keys

by Jack Lyon

I recently had the pleasure of doing an interview for the Chicago Manual of Style “Shop Talk” column. In the interview, I explained how to record a simple macro for transposing characters while editing.

After reading the interview, editor Kristi Hein commented:

Terrific. Next, please discuss the process of choosing a keystroke combination for your macro: not using one of the many you’ve already assigned, making it a combo that’s not too convoluted for the hands (defeating the purpose somewhat), and that you will remember among all the other keystroke combinations you’ve assigned. Therein lies the true art of automating Word effectively and efficiently.

Kristi is right, but wow, that’s a tall order. Let’s look at each requirement separately.

Not using one of the many we’ve already assigned

To not use one of the many keyboard combinations already assigned, we need to know the keystroke combinations we’ve already assigned. Here’s how to do that:

  1. Click CTRL + P to open Word’s “Print” dialog.
  2. Under “Settings,” click the dropdown list that begins with “Print All Pages.”
  3. Under “Document Properties,” click “Key Assignments.” (Also, notice the other things you might want to print, such as styles and AutoText entries.)
  4. Click the “Print” button.

You’ll get a nicely formatted document that shows all of your existing key combinations. The entries will look something like this, with the key combinations on the left and the macro names on the right:

Alt+Ctrl+Shift+S — Normal.NewMacros.ChangeStyleBasedOn
Alt+Ctrl+Shift+I — Normal.NewMacros.CheckIndexCodes
Alt+Ctrl+Shift+C — Normal.NewMacros.FixCodes
Alt+Ctrl+Shift+M — Normal.NewMacros.ParseMetadata

“And how do I assign key combinations to begin with?” you’re wondering. There are (at least) a couple of ways:

When you go to record a new macro (under View > Macro), one of your options is to assign a key combination by pressing the “Keyboard” button:

Using the keyboard option

Using the keyboard option

When you do that, you’ll see the following dialog:

The dialog for entering the key combination

The dialog for entering the key combination

If you were working with an existing macro (editing rather than recording), you’d see any existing key combinations under “Current keys.” To assign a new combination, put your cursor in the box labeled “Press new shortcut key” and, well, press a new shortcut key.

If the new key is already assigned to a macro, you’ll get a “Currently assigned to” message like this:

Currently assigned message

Currently assigned message

That’s handy because it helps you avoid accidentally overwriting a combination that you’ve already assigned (although you can overwrite one on purpose). If you don’t get that message, you’re good to go, and you can click the “Assign” button (on the lower left) and then the “Close” button (on the lower right) and then record the keystrokes that will make up your macro. (When you’re finished recording, click View > Macro > Stop Recording.)

If you want to assign a key combination to an existing macro, things get a little more complicated:

  1. Click “File > Options.”
  2. Click the “Customize Ribbon” button (on the left).
  3. Under “Choose commands from,” select “Macros” (unless you want to use one of Word’s built-in commands, which you can also do).
  4. At the bottom of the dialog, you’ll see “Keyboard shortcuts: Customize.” Click the “Customize” button and proceed as explained above.
Customizing

Customizing

But to continue…

Making it a combo that’s not too convoluted for the hands

This, of course, depends on how many fingers you have (I have ten so far) and how large or small they are, along with your native dexterity. As you can see in the picture above, I’m partial to ALT + CTRL + SHIFT, which I actually find easy to press with my left hand while pressing a letter key with my right. If that’s too convoluted for you, you might try CTRL + SHIFT or CTRL + ALT, both of which are easy to do. ALT + SHIFT is a little more difficult. You can even use plain old CTRL or ALT with another character, but that starts to encroach on Word’s built-in key combinations (like CTRL + S to save a document).

There’s another system, however, that you may not know about:

  1. Press your desired key combination.
  2. Press another key.

The result will be something like this:

Two-step key

Two-step key

See that ,”1” after the “Alt+Ctrl+Shift+M”? That means I’ve just created a two-step key combination. To run the macro, I press ALT+CTRL+SHIFT+M. Then I press 1 (the one key, all by itself). At that point (and not before), the macro will run. Pretty slick!

What that means is that you can assign all kinds of two-step combinations (letters will work as well as numbers), which gives you two characters for the mnemonic you use to remember what a combination does. That’s twice as good as one! (Unfortunately, Word won’t let you use more than two.) It also means you can create shortcuts like these:

ALT+CTRL+SHIFT+H,1 (to apply the Heading 1 style)ALT+CTRL+SHIFT+H,2 (to apply the Heading 2 style)

Or these:

CTRL + SHIFT + T,C (to transpose characters)
CTRL + SHIFT + T,W (to transpose words)
CTRL + SHIFT + T,S (to transpose sentences)
CTRL + SHIFT + T,P (to transpose paragraphs)

And so on. The mind reels at the possibilities!

Making it a combo that you will remember among all the other keystroke combinations you’ve assigned

Using two-step combinations should help with that requirement as well, but for serious keyboard junkies there’s another solution — XKeys. The company manufactures various models, from 24 keys on up to 128 keys! You can assign the keys to your macros, label the keys, color code them, and so on. The 60-key model looks like this:

The 60-key XKeys

The 60-key XKeys

Rich Adin swears by this gadget, and he’s one of the most productive copyeditors I know. Maybe you’d find it useful too.

We've met the requirements

In summary, we’ve figured out some ways to meet all of Kristi Hein’s requirements for key combinations:

  • Not using one of the many you’ve already assigned.
  • Making it a combo that’s not too convoluted for the hands.
  • Making it a combo that you will remember among all the other keystroke combinations you’ve assigned.

These may seem like small things, but small things add up to greater editing efficiency, and that means more money in your pocket and less time at work, both of which are big things. I hope this essay will help you achieve them.

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Posted in Computers and Software, Contributor Article, Editing Tools, Editorial Matters, Lyonizing Word | Tagged , , , , | 3 Responses

Better word processing: The Chicago Manual of Style interview

The Chicago Manual of Style "Shop Talk" column recently noted:

"When it comes to word processing, CMOS users probably represent every level of expertise (or nonexpertise), but regardless of skill level, we all experience frustration at times when we don’t know how to accomplish a task on our computers. Often we do something the way we’ve always done it—the slow way—because it just seems too difficult or scary to try to automate it. Is there a cure?"

There is a cure, as I explain in my interview with CMOS "Shop Talk." I grew up as a book editor by following the Chicago Manual of Style, so it was a real thrill for me to do the interview. I hope you'll find it interesting and useful.

Best wishes,

Jack Lyon

Posted in Editing, Macros, Microsoft Word, Uncategorized | Comments closed

Lyonizing Word: From Easy to Impossible — Three Variations on a Theme

by Jack Lyon

Rich Adin just keeps on escalating the difficulty of his requests. That’s okay, because I appreciate a good challenge. Here’s his latest:

Okay, Jack, you solved the problem of reducing the number of authors from more than three down to three.

To see what Rich is talking about, please see my previous posts here: Lyonizing Word: We Can Do This the Easy Way, or . . . and Lyonizing Word: The Easy Way, Not So Easy.

Rich continues:

But there is a caveat: the list of names needs to end with “et al:”. So let me pose three more variations.

Three?! Oh, all right. Here we go:

Variation 1

How do I handle instances where the ending is punctuation other than “et al:”? For example, it could be a different punctuation mark than the colon or it could end with an author name and not “et al” (e.g., “Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W:” or “Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W, Hoffnagle TTP.”)

How do we handle instances where the ending is punctuation other than “et al:”? Here are Rich’s examples, all laid out for our inspection:

Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W:

Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W, Hoffnagle TTP.

As usual, the key is to find the “handle,” the unique elements we can grab to carry out our search. (For more on this, please see my article “What’s Your Handle?” [2003] at the Editorium Update.)

In Rich’s examples, the “handles” would have to be the colon that ends the first entry and the period that ends the second. Let’s try modifying the wildcard string from the previous post for Lyonizing Word:

([!^013]@, [!^013]@, [!^013]@, )[!^013]@([:.])

Here’s what that means:

Find any characters except a carriage return: [!^013]
repeated any number of times: @
followed by a comma
followed by a space
repeated three times
and enclosed in parentheses to form a “group.”
Then find any character except a carriage return: [!^013]
repeated any number of times: @
followed by [:.] (specifying a colon or a period) in parentheses to form a group.

And we can use the following in the “Replace With” box:

12

Here’s what that means:

Replace everything that was found
with the text represented by group 1: 1
followed by the text represented by group 2: 2

But does that actually work? Well, sort of, Here’s what we get:

Lyon J, Adin R, Carter TO, :
Lyon J, Adin R, Carter TO, .

Maybe that’s close enough, as it would now be an easy matter to search for comma space colon and replace it with a colon, and to search for comma space period and replace it with a period. But if we want to refine our search string even further, we could use this:

([!^013]@, [!^013]@, [!^013]@), [!^013]@([:.])

Here, we’ve placed the comma and space following the third name outside the parenthetical group, so they’re not included when the group is replaced by /1. That actually solves the problem, if you want to get precise, giving us a result like this:

Lyon J, Adin R, Carter TO:
Lyon J, Adin R, Carter TO.

Variation 2

Rich wrote:

How can I revise the string to work even if there is no consistency in punctuation of names? For example, suppose the names are: “Lyon, J, Adin R, Carter T.O., Jackson TT, Doe, J.; Smith K; Winger, W; Hoffnagle TTP.”

As given, this can’t be done. Why? Because we’ve lost the uniqueness of the comma “handles” that separate the names. For example, instead of this —

Lyon J,

— we have this:

Lyon, J,

And instead of this —

Smith K,

— we have this:

Smith K;

So again, as given, we can’t fulfill Rich’s request. But can we change the “as given”? Why, yes, we can!

We can search for a lowercase letter followed by a comma (at the end of a last name) and replace it with just the lowercase letter (and no comma):

Find what: ([a-z]),
Replace with: 1

We can search for a semicolon (which sometimes follows initials) and replace it with a comma:

Find what: ;
Replace with: ,

Then we can use the same wildcard string we used earlier to fulfill Rich’s request:

Find what: ([!^013]@, [!^013]@, [!^013]@), [!^013]@([:.])
Replace with: 12

You may be wondering if these wildcard strings will affect the article titles and journal names and not just the author names. The answer is, it depends. I’m assuming, for example, that the article titles and journal names don’t include commas (just for purposes of illustration). But if they do, you may have to get creative. Let’s take this as an example:

Levy, D, Ehret G, Rice K, Verwoert G, Launer L, Dehghan A, Glazer N, Morrison A, Johnson A, Aspelund T, Ganesh S, Chasman D: Genome-wide association study of blood pressure, stress, and hypertension. Nature 2009, 41(6): 677-687.

See that comma after “Levy”? Above, we got rid of it with the following strings:

Find what: ([a-z]),
Replace with: 1

But notice that this will also remove the commas after “pressure” and “stress” in the article title, which we don’t want to do. The solution, again, comes down to handles. What do we have that sets off the article title and journal name? In this example, they’re preceded by the colon after the author names (“Chasman D:”) and followed by a carriage return (at the end of the citation). So here’s a rather sneaky solution: Search for a colon followed by anything that isn’t a carriage return until you come to a carriage return. Then replace whatever was found with itself (^&) formatted as Hidden:

Find what: :[!^013]@^013
Replace with (use Hidden formatting): ^&

If you don’t know how to replace using formatting, here’s the secret:

1. Put your cursor in the “Replace with” box.
2. Click the “More” button if it’s showing.
3. Click the “Format” button on the bottom left.
4. Click “Font.”
5. Put a check in box labeled “Hidden.”
6. Click the “OK” button.

Notice that you can replace with all kinds of formatting: styles, paragraph alignment, and so on. You can also use formatting in the “Find what” box! This is really powerful stuff, and if you didn’t know about it before, now you can add it to your bag of tricks.

At any rate, with the article titles and journal names formatted as Hidden, you can make sure they actually are hidden by clicking the “Show/Hide” button (with the pilcrow icon: ¶) on Word’s “Home” tab. Then run your find and replace to remove commas from last names:

Find what: ([a-z]),
Replace with: 1

Finally, unhide the article titles and journal names (after using “Show/Hide” to display them):

Find what: (Hidden formatting)
Replace with: (Not Hidden formatting)

At that point, the commas will be gone from the authors’ last names but preserved in the article titles and journal names.

By the way, if you’re working on a Macintosh, you’ll find that Word doesn’t recognize the standard code for a carriage return (^013) while searching with wildcards. But never fear: you can still do what you need by “escaping” the code with a backslash and treating it as a range using square brackets. In other words, use this:

[ˆ013]

To specify not a carriage return, use the following:

[!ˆ013]

Variation 3

Rich wrote:

How can I adapt the wildcard string to delete those in excess of a certain number? For example, I have one client who wants up to ten author names listed and “et al” used only for names eleven and following. I would like to specify how many names I want retained and replace the excess with “et al.” For example, if there are fifteen names, delete the last five if ten are okay and replace them with “et al.”

Theoretically, we could do that as long as there’s a “handle” that marks the end of the names. Let’s take this example:

Levy D, Ehret G, Rice K, Verwoert G, Launer L, Dehghan A, Glazer N, Morrison A, Johnson A, Aspelund T, Ganesh S, Chasman D: Genome-wide association study of blood pressure and hypertension. Nature 2009, 41(6): 677-687.

There are actually twelve names there, so we want to keep the first ten and replace the last two with “et al.” What’s our handle? The colon after the last name (“Chasman D:”) and before the article’s title. So let’s try an expansion of the wildcard search string we used in the previous post for Lyonizing Word. Instead of grouping three comma-separated names, we’ll group ten:

Find what: ([!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@, [!^013]@,)[!^013]@(:)
Replace with: 1 et al.2

That would work if Word could handle it. But if you try it, Word will complain: “The Find What text contains a Pattern Match expression which is too complex.” So now what? Honestly, I’m not sure. I tried several other possibilities, none of which were successful. So if you, Gentle Reader, have any ideas about how to accomplish this seemingly impossible feat, I’d love to hear them.

Wildcard searching can’t do everything, but it can do an awful lot. As I’ve said before, after all these years of editing, wildcard searching is the tool I rely on the most. I encourage you to invest the time needed to learn to use this tool, which will repay your efforts many times over. A good place to start is my free paper “Advanced Find and Replace in Microsoft Word.”

I hope you’ll also watch for my forthcoming Wildcard Cookbook for Microsoft Word. I’m still trying to find more real-life examples for the book, so if you have some particularly sticky problems that might be solved using a wildcard search, I hope you’ll send them my way. Maybe I can save you some work and at the same time figure out solutions that will help others in the future. Thanks for your help!

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

For other Lyonizing Word essays at An American Editor, Lyonizing Word at AAE.

Posted in Contributor Article, Lyonizing Word | Tagged , , , | 4 Responses

Lyonizing Word: The Easy Way, Not So Easy

by Jack Lyon

After publishing my last article, Lyonizing Word: We Can Do This the Easy Way, or . . ., Rich Adin, An American Editor, wrote:

As written, your wildcard find and replace reduces four names to three if “et al:” is the ending characteristic. How do you write it so that it can handle any number of names, say up to seven?

Good question, and a nice challenge for a wildcard search. Let’s say we have citations with strings of names like this:

Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W, et al: blah blah blah

That’s seven names, but let’s see if we can make a wildcard string that will find any number of names and cut them down to three. My first impression is that this might be difficult or even impossible. But let’s try the following wildcard string:

([!^013]@, ){3}([!^013]@, ){1,}(et al:)

Here’s what that means:

Find any character except a carriage return: [!^013]
repeated any number of times: @
followed by a comma
followed by a space
and enclosed in parentheses to form a “group.”
Do that three times in a row: {3}
Find using the same group: ([!^013]@, )
if it occurs once or more (as indicated by the comma): {1,}
followed by “et al:” in parentheses to form a group.

There’s just one problem: It doesn’t work. And that’s how it often is with wildcards — sometimes you have to fiddle around to get the result you want; trial and error are key. So let’s see if we can find just three instances of text using our group:

([!^013]@, ){3}

That doesn’t work either. What in the world is going on here? Let’s try using the group three times in a row:

([!^013]@, )([!^013]@, )([!^013]@, )

That does work. So why not this?

([!^013]@, ){3}

Could it be that {3} doesn’t apply to the wildcard pattern ([!^013]@, ) itself but to the first instance of text that pattern finds? In other words, would that wildcard string  find the first three names in a citation like the following?

Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, et al: blah blah blah

Sure enough, that works! So we’ve just learned something new about wildcard searches. For clarity, I’ll restate it here:

Specifying how many times to find something (using {3}, for example) doesn’t apply to the wildcard pattern it follows but to the first instance of text that pattern finds.

Unfortunately, that means we need to work out a different approach to our original problem. How about this?

([!^013]@, [!^013]@, [!^013]@, )([!^013]@, ){1,}(et al:)

Here’s what that means:

Find any character except a carriage return: [!^013]
repeated any number of times: @
followed by a comma
followed by a space
repeated three times
and enclosed in parentheses to form a “group.”
Find using the same group: ([!^013]@, )
if it occurs once or more (as indicated by the comma): {1,}
followed by “et al:” in parentheses to form a group.

But no, that doesn’t work either! Why not? Oh, yeah, because of that {1,}. As we discovered earlier:

Specifying how many times to find something (using {3}, for example) doesn’t apply to the wildcard pattern it follows but to the first instance of text that pattern finds.

Well, okay, then. We’ll stop using numbers (such as {1,}) to specify how many times a pattern should be repeated (at least for our current purposes). Let’s try this instead:

([!^013]@, [!^013]@, [!^013]@, )[!^013]@(et al:)

Here’s what that means:

Find any characters except a carriage return: [!^013]
repeated any number of times: @
followed by a comma
followed by a space
repeated three times
and enclosed in parentheses to form a “group.”
Then find any character except a carriage return: [!^013]
repeated any number of times: @
followed by “et al:” in parentheses to form a group.

Well, son of a gun; that actually works. So now we can use the following in the “Replace With” box:

12

Here’s what that means:

Replace everything that was found
with the text represented by group 1: 1
followed by the text represented by group 2: 2

Group 1, you’ll remember, was this:

([!^013]@, [!^013]@, [!^013]@, )

It finds the first three names in our citations. And group 2 was this:

(et al:)

It finds the end of our citations.

And so, finally, we’ve succeeded in fulfilling Rich’s original request:

As written, your wildcard find and replace reduces four names to three if “et al:” is the ending characteristic. How do you write it so that it can handle any number of names, say up to seven?

Sometimes the easy way isn’t so easy. Nevertheless, it’s almost always worth pursuing. In Rich’s case, it reduced his editing time from hours (removing extraneous names by hand) to minutes (removing the names with a wildcard find and replace). It also gave Rich a wildcard search that he can save in his fabulous EditTools software for use with future projects. And it provided a deeper and clearer understanding of how to use wildcard searches.

After all these years of editing, wildcard searching is the tool I rely on the most. I encourage you to invest the time needed to learn to use this tool, which will repay your efforts many times over. A good place to start is my free paper “Advanced Find and Replace in Microsoft Word.”

I hope you’ll also watch for my forthcoming Wildcard Cookbook for Microsoft Word. I’m still trying to find more real-life examples for the book, so if you have some particularly sticky problems that might be solved using a wildcard search, I hope you’ll send them my way. Maybe I can save you some work and at the same time figure out solutions that will help others in the future. Thanks for your help!

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.


 

Looking for a Deal?

You can buy EditTools in a package with PerfectIt and Editor's Toolkit at a special savings of $78 off the price if bought individually. To purchase the package at the special deal price, click Editor's Toolkit Ultimate.

Posted in Computers and Software, Contributor Article, Editing Tools, Lyonizing Word | Tagged , , , , | Leave a comment

Lyonizing Word: We Can Do This the Easy Way, or . . .

We Can Do This the Easy Way,
or We Can Do This the Hard Way

by Jack Lyon

American Editor Rich Adin called me recently with a puzzle. He was editing a list of citations that looked like this:

Lyon J, Adin R, Poole L, Brenner E, et al: blah blah blah.

But his client wanted the citations to look like this:

Lyon J, Adin R, Poole L, et al: blah blah blah.

In other words, many of the citations included one author name too many; the client wanted a limit of three rather than four. And there were hundreds of citations. Rich really didn’t want to remove the superfluous names by hand; it would have taken hours to do, and hours are money. And so, Rich queried, “Is there a way to remove the fourth name automatically?”

There’s nearly always a way. Rich had already tried using a wildcard search, but without success. Microsoft Word kept telling him, “The Find What pattern contains a Pattern Match expression which is too complex.”

The Too-Complex Find What

I’m not sure what wildcard search Rich tried to use, but it might have looked like this:

Find what:

([A-Z][a-z]@ [A-Z], )([A-Z][a-z]@ [A-Z], )([A-Z][a-z]@ [A-Z], )([A-Z][a-z]@ [A-Z], )(et al:)

Replace with:

1235

That’s definitely too complex for Word to handle. Here’s what it means:

Find a capital letter ([A-Z])
followed by a lowercase letter ([a-z])
repeated any number of times (@)
followed by a space
followed by a capital letter ([A-Z])
followed by a comma
followed by a space
with all of that in parentheses to form a “group.”

All of that is repeated three more times, then followed by “et al:” in parentheses to form a group.

The “Replace with” string tells Word to replace what it finds with the contents of groups 1, 2, 3, and 5 — in other words, with the first three names followed by “et al:”.

What’s the Handle?

If Word could handle it, that should work. But Word can’t handle it, so we’ll need to simplify. So we ask ourselves, “What, besides letters, do all of the names have in common?” In other words, “What’s the handle? What can we grab onto?” Well, that’s easy — each name is followed by a comma and a space. That’s our handle!

(For more on this, please see my article "What’s Your Handle?" (2003) at the Editorium Update.)

The Find That Works

The handle means we can simplify our wildcard search string to something like this:

Find what:

([!^013]@, [!^013]@, [!^013]@, )[!^013]@, (et al:)

Replace with:

12

Here’s what that means:

Find any characters except a carriage return ([!^013])
repeated any number of times (@)
followed by a comma
followed by a space
with all of that repeated three times
and enclosed in parentheses to form a “group.”
Then it’s repeated one more time, ungrouped
and followed by “et al:” in parentheses to form a group.

The “Replace with” string tells Word to replace what it finds with the contents of groups 1 and 2 — in other words, with the first three names (group 1) followed by “et al:” (group 2). The fourth name is simply ignored.

To Group or Not to Group Using Parens

Rich ran the new find and replace, then replied, “Thanks, Jack, that works like a charm. Why isn’t the second ‘group’ grouped, that is, in parentheses? I thought that was necessary.”

I replied, “No, it’s not necessary. You group only the items that you want to reference (by 1, 2, etc.) in the ‘Replace with’ box. You could group the other item, in which case you would use ‘13’ in the ‘Replace with’ box. But there’s no need to do so.”

Note that this method of finding the names offers another advantage. Not only will it find names that look like this:

Lyon J,

it will also find names that look like this:

Lyon JM,

or even this:

Lyon JMQ

It will even find names like this:

Thaler-Carter Ruth,

or this:

Harrison G.B.H.,

In fact, it will find anything (except a carriage return) followed by a comma and a space.

Why the Carriage Return?

“Why,” you may be wondering, “specify anything but a carriage return? Why not specify letters instead?” Well, we could have done that, using something like this:

Find what:

([A-z ]@, [A-z ]@, [A-z ]@, )[A-z ]@, (et al:)

Replace with:

12

That means:

any capital or lowercase letter or space ([A-z ])
repeated any number of times (@)
followed by a comma
followed by a space
And so on.

Such a wildcard string would find names like this:

Lyon J,

but not this:

Thaler-Carter R,

Yes, we could add a hyphen to our string, but then we start to wonder about other characters we might need to include, and then things get complicated again. And besides, it’s true that we don’t want to include carriage returns in our search, so it makes sense to exclude them. If we tried to simplify too far, we might use this:

Find what:

(*, *, *, )*, (et al:)

Replace with:

12

The problem with using the asterisk wildcard (*) is that it finds any character any number of times, including tabs, spaces, carriage returns, and everything else you can think of. Sometimes that’s useful, but more often it just leads to confusion. We want to keep things simple but not too simple.

Why Wildcard

To return to our original problem: Rich could have removed all those extra names one at a time, by hand, which is doing it the hard way and eats into the profit line — remember that time is money. Microsoft Word includes powerful tools for doing things the easy way, so why not learn them and use them? If you’ve read this far, you’re doing that, so congratulations.

If you’d like to learn more about how to use wildcard searches, you can download my free paper “Advanced Find and Replace in Microsoft Word.” Working through the paper requires some thought and effort, but the payoff is huge.

Coming Soon

I hope you’ll watch for my forthcoming Wildcard Cookbook for Microsoft Word. I’m still trying to find more real-life examples for the book, so if you have some particularly sticky problems that might be solved using a wildcard search, I hope you’ll send them my way. Maybe I can save you some work and at the same time figure out solutions that will help others in the future. Thanks for your help!

For EditTools Users

If you are a user of EditTools, you can manually create the find and replace strings in the Wildcard Find & Replace macro and then save the macro for future use. However, to do so you need to enter the Find string slightly differently:

Find Field #1: [!^013]@, [!^013]@, [!^013]@,
Find Field #2: [!^013]@,
Find Field #3: et al:

Note that you omit the parens for grouping because EditTools automatically inserts them, which means that you break the string into its group components. (IMPORTANT: Be sure to include in Find Fields 1 and 2 the ending space, i.e., the space following the final comma, which is not visible above.)

Because EditTools treats each of the three fields as a group, your Replace string is:

Replace Field #1: 1
Replace Field #2: 3

After manually entering the information in each of the fields, click Add to WFR Dataset and save this macro for future use. Next time you need it, just click Retrieve from WFR Dataset, retrieve this string, and run it. That is one of the advantages to using EditTools' Wildcard Find & Replace — you can write a wildcard macro once and reuse it as many times as you need without having to recreate the macro each time.

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Looking for a Deal?

You can buy EditTools in a package with PerfectIt and Editor's Toolkit at a special savings of $78 off the price if bought individually. To purchase the package at the special deal price, click Editor's Toolkit Ultimate.

 

Posted in Computers and Software, Contributor Article, Editing Tools, Editorial Matters, Lyonizing Word | Tagged , , , , , | 2 Responses