An American Editor

November 7, 2012

The Business of Editing: Wildcard Macros and Money

I thought the mention of money might catch your interest :). But macros, especially wildcard macros, and money do go hand in hand. Consider the following two scenarios I recently experienced in the references of a project (same project, different chapters).

In the first scenario, there were, over two chapters, nearly 500 references that the authors had formatted like this:

Agarwal, S., Loh, Y. H., Mcloughlin, E. M., Huang, J., Park, I. H., Miller, J. D., Huo, H., Okuka, M., Dos Reis, R. M., Loewer, S., Ng, H. H., Keefe, D. L., Goldman, F. D., Klingelhutz, A. J., Liu, L. & Daley, G. Q. (2011) Telomere elongation in induced pluripotent stem cells from dyskeratosis congenita patients. Nature, 464, 292-6.

In the second scenario, the references were formatted like this:

Adhami F, G Liao, YM Morozov, et al: “Cerebral ischemia-hypoxia induces intravascular coagulation and autophagy.” Am J Pathol 2006;  169(2): 566-583.

What they need to look like is this:

Airley R, Loncaster J, Davidson S, et al. Glucose transporter glut-1 expression correlates with tumor hypoxia and predicts metastasis-free survival in advanced carcinoma of the cervix. Clin Cancer Res 2001;7(4):928-934.

The money question is how to I get the references from where they are to where they need to be quickly and efficiently so that I make money and not lose money? The answer lies in wildcard macros.

For most editors this is a daunting task that needs to be tackled manually. In the first scenario, the editor will manually remove each extraneous period, manually move the year to precede the volume number, and manually correct the punctuation problems in the citation. In other words, most editors will spend a good two or three minutes — if not longer — correcting each reference entry. I, on the other hand, spent less than 30 minutes cleaning up these references and verifying the journal names.

It is not that I am a brilliant macro writer — I am not. A skilled macro writer is someone like Jack Lyon, the creator of the Editorium macros that so many of us use. Instead, what I am is a smart user of the tools that will help me accomplish what needs to be done. In this case, I am a smart user of EditTools’ Wildcard Find & Replace (WFR) macro tool.

WFR has been designed to make creating and using wildcard macros easy. You do not need to know how to write the macros, the tool will do it for you; instead, you need to know how to tackle a problem, how to break it down into its component parts.

The first step is to find a pattern. Remember that macros are dumb and work on patterns. I began by analyzing the patterns in the author names: Agarwal, S., Loh, Y. H., Mcloughlin, E. M. I realized that, for example, each of the first names was represented by an initial followed by a period and a space except that the final initial was followed by both a period and a comma (e.g., Y. H.,). Thus each group was separated by a period-comma combination. I also noticed that some authors had a single initial and some had two initials (and I recalled from other reference lists that some authors had three initials).

Beginning with the single initial name, I used WFR to create the first macro. WFR lets me select from menus what I want (e.g., the Character menu gives me several options, including Exact Characters, Exclude Characters, lower case, UPPER CASE, Mixed Case) and based on my selection, WFR creates the entry for me (e.g., choosing UPPER CASE in the first field inserts an unlimited [A-Z]@ into the field, which WFR turns into ([A-Z]@), the correct form for a wildcard). I do not need to know how to write the entry, I need only give the correct instruction. Thus, the first thing I wanted the macro to find was the surname, which is mixed case. So from the menu of options, I chose Mixed Case and unlimited (unlimited because some surnames are short and others are long and I need to cover all of them) and WFR created ([A-Za-z]@) for me.

I continued to make my selections by filling in the fields in the WFR form so that in the end the fields were filled in for me like this (the @ indicates any number of the find criterion; the {1,1} indicates a minimum of 1 and a maximum of 1 of the find criterion; and in #3 and #7, preceding the { is a space):

Field #    Find                Replace
1              [A-Za-z]@       \1
2              ,                         \3
3               {1,1}                 \4
4             [A-Z]{1,1}          \6
5             .                           \7
6             ,
7               {1,1}

The Replace fields are where I tell the macro what to replace the find with. Again, this can be achieved by making selections from a menu. The \4, for example, indicates that what I want is found in field #4. So the Replace information tells the macro that I want the found criteria replaced with Surname (#1), a space (#3), the initial (#4), a comma (#6), and a space (#7). WFR creates a wildcard find string that looks like this:

([A-Za-z]@)(,)( {1,1})([A-Z]{1,1})(.)(,)( {1,1})

and a replace string that looks like this:


and when the macro is run, every author name that looks like

Agarwal, S.,


Agarwal S,

Clearly, this one macro is not enough to clean up all the variations. In fact, for the first scenario it took 11 macros just for the name cleanup. But this is another feature of WFR. After I create a macro, I can save it, with a lengthy description, in a file with similar macros so I can use the macro again without having to create it again. But to have to run 11 macros individually is time-consuming, so WFR will let me create a script that will run all 11 macros in whatever order I want them to run.

A script is easy to create — you just double-click on the macros you want to add to a script and then save them. The script can be added to or subtracted from at any time.

Ultimately, I created another set of four macros to deal with the author names in the second scenario. All of these macros — those for scenario 1 and those for scenario 2 — can be modified to deal with different patterns as the need arises. I will not have to keep reinventing the macros.

Another feature of WFR is that the macros are editable. If you discover that you should have included or omitted something, you do not need to recreate the entire macro; just choose to edit it.

And WFR lets you test the macro to make sure it works as you expect. (One note of caution when working with wildcard macros: It is best to turn tracking off. With tracking on, wildcard macros often produce bizarre results. Run the same macro with tracking off and everything works fine.)

It took me about 30 minutes to write all of the macros for both scenarios. Once I wrote them, however, when I came to the next chapter that needed the cleanup, the cleanup was done in less than a minute. Compare a less-than-a-minute cleanup time to the time it would take to do the cleanup manually. The wildcard macros make me money by making my work easy, quick, and efficient.

The beauty of EditTools’ Wildcard Find & Replace macro is that you do not need to be a macro guru to create these macros. You simply need to break the tasks down into steps and use WFR to create the macros for you. One important point that is worth repeating: Macros are dumb. They will do what you tell them to do even if they shouldn’t. It is still your responsibility as an editor to check the items. Macros do make mistakes.

If you haven’t tried WFR, you should. It is an easy way to delve into the world of wildcard macros. And unlike using the wildcard feature of Word’s Find & Replace, WFR lets you save the macros for future use and gives you a way to run several wildcard macros sequentially without having to create them.


  1. Sounds great and I like the concept, but you’d need a lot of references to make it worthwhile. Yes, nearly 500 citations would get me looking for any kind of automation, but for 10 or 20 I would probably be mainly manual with maybe a minor macro (and some contrived alliteration for good measure). Nevertheless I like the sound of WFR and recall a few times when it would have been useful. I’m going to check it out.


    Comment by Jim — November 7, 2012 @ 5:04 am | Reply

    • If you work, for example, on journal articles so that there are few references in each article, on the surface it appears that it is as quick and easy to do the corrections manually. But that is only true for the one article. The idea of macros, and the WFR macro in particular, is that you write the macro once and reuse it numerous times. Over the course of reuse the time savings builds.

      How long would it take you to manually clean up 10 of the references like those in the article? It would need to take at least 2 minutes a reference, I would guess. If true and if you have 10 articles with 10 references (average) in each article that require this type of cleanup, dot do them all would take 200 minutes (100 references x 2 minutes = 200 minutes [3 hours, 20 minutes). With the macros, the first 10 references might take 30 minutes so that you can write the macros, but then the remaining 190 references in the remianing 9 articles could all be done in less than aminute.

      Seems to me that the macros would be very useful.


      Comment by americaneditor — November 7, 2012 @ 6:02 am | Reply

      • I have to echo this sentiment. I do a lot of academic editing work and references are always a bear, no matter how few or many there are. Ensuring citations in text are formatted correctly, that the reference list is formatted correctly, and that the items cited in text are in the reference list and vice versa—that takes a lot of time. Now if only there were a macro to format tables properly, since that’s the other time-suck!


        Comment by Corinne Colbert — November 7, 2012 @ 10:19 am | Reply

  2. I can’t use EditTools because I work on a Mac, so I did some Googling and found a downloadable book of macros for Word on both Windows and Mac. I haven’t implemented any of them yet, but I will before I get my next editing assignment!


    Comment by Corinne Colbert — November 7, 2012 @ 10:16 am | Reply

  3. All right. With this post, I think you’ve finally convinced me to try to automate at least some of my reference list cleanup using EditTools. Everybody please cross all fingers and toes that I will be able to think through the search strings!


    Comment by Rebecca — November 7, 2012 @ 4:35 pm | Reply

    • Rebecca, the way editing is evolving, especially with the continued consolidation of the publishing industry and the belief by publishers that anyone anywhere can provide a quality edit for any book for any audience (lots of anys in the concept), the only way for an editor to truly increase their effective hourly rate by a significant amount is automation. This is not to say that taks can be automated and accepted without a second glance; they cannot. It is to say, however, that if automation can correctly do 95% of a task, it will take less time to tackle the remaining 5% than if you had to tackle 100%.

      A couple of things to remember: First, when you write your macro, do not automatically run the Replace All function. Do everything in steps, slowly and carefully until you are certain that the macro does what you want and only what you want. Second, break tasks down into very small increments. Do not try to overcomplicate things. It is better to write 11 macros that work correctly to accomplish a combined larger task than to try to write one macro to do it all. “Smaller” macros are easier to correct and easier to isolate as a wrongdoer should something get messed up. Third, once you have written your multiple macros, think about the order in which they need to run. Running the macros in the wrong order can cause some to not work or to work incorrectly because earlier run macros have made changes that disrupt the later macro’s find criteria. Finally, once you have your macros written and your order set, create a script to run the macros sequentially. This way, you run a single script, which runs the 11 macros, rather than run each of the 11 macros individually.

      One other thing: Wildcard Find & Replace gives you an opportunity to write a lengthy description of your macro. Make use of that feature so that when you see the macro in the future, you understand exactly what you wrote it to do.

      I expect you will do just fine writing your wildcard macros.


      Comment by americaneditor — November 8, 2012 @ 4:15 am | Reply

  4. […] have discussed wildcard macros before (see, e.g., The Only Thing We Have to Fear: Wildcard Macros, The Business of Editing: Wildcard Macros and Money, and Macro Power: Wildcard Find & Replace; also see the various Lyonizing Word articles), […]


    Pingback by The Business of Editing: Wildcarding for Dollars | An American Editor — February 18, 2015 @ 4:02 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at

%d bloggers like this: