h1

Word: Switch the number and punctuation order

October 29, 2017

On another blog post, Peter asked for some help:

I have hundreds of superscript characters (not footnote markers) that have a space before them and punctuation (periods and commas only) after them. I’m trying to delete the space and move the punctuation in front of it.

You can do this using a find/replace with wildcards. However, the instructions below DON’T differentiate between numbers that are superscripted and numbers that aren’t, so it will switch those too. If you don’t have any instances of <space>single ordinary number<period or comma>, then you should be fine. I suggest you try this on a COPY of your document and make sure you get what you want and nothing more, before using it on your main document.

Steps:

  1. Press Ctrl+H to open the Find and Replace dialog box.
  2. Click More, then select the Use wildcards option.
  3. In the Find field, type: ( )([0-9])([.,])
    (Note: There’s a space between the first set of parentheses. Because you have hundreds of these, there’s a good chance that you won’t have just single digit numbers. For multi-digit numbers, type this instead: ( )([0-9]@)([.,])
  4. In the Replace field, type: \3\2
  5. Click Find Next then click Replace. Repeat.

(Note: Only click Replace All if you are certain that no other ordinary numbers will be affected.)

What you are doing here is looking for a space (item 1), followed by any single digit number (item 2), followed by either a period or a comma (item 3). Then you’re replacing that string with the period or comma (item 3) then the number (item 2).

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: