1

I have a 150-page reference file (a Microsoft Word document) where the dates are in British (dd Mmmm yyyy) format and I'd like them in American (Mmmm dd, yyyy) format.  Is it possible to use wildcards to search and replace and transpose all instances of:

  • "dd Mmmm yyyy" to "Mmmm dd, yyyy"; e.g., 1 December 2001 to December 1, 2001

  • "dd Mmmm." to "Mmmm dd."; e.g., 1 December. to December 1.

  • Can you please edit your question to explain what you are trying to accomplish. As it stands, there is no need for wildcards to change all instances of "1 December 2001 to December 1, 2001" to "1 December. to December 1". But I suspect that's no really what you want to accomplish – cybernetic.nomad Feb 11 at 14:59
  • There is a need for the file I am working on to change the formats. What I've described is exactly what I'm trying to accomplish. Appreciate any help anyone can give me. I have found [0-9]{1,2} <[AFJMNSOD]*> which will find the DD MM and select it, I just haven't found what wildcards I'd use to transpose them and add a comma(,) after the DD. – Peter Amirault Feb 11 at 15:43
1

I believe that this won’t be possible with a single search-and-replace in Microsoft Word.  It would be easier if you were dealing with a text file and you had access to GNU/Unix tools like sed; but I’ll answer the question you asked.

  1. Identify a character or sequence (string) of characters that never appears in your document.  Do not use any of the characters (, ), [, ], {, }, <, >, @, ^, *, \, ? and !.  For an ordinary document (i.e., one that isn’t about computer stuff), | may suffice.  If you have that in your document, try something like |foo|, ### or %%%.  I’ll assume that | works for you.
  2. In Word’s “Find and Replace” dialog (type Ctrl+H),
    • Click on the “More >>” button, and
    • Check the “Use wildcards” option.
  3. Then enter

    • “<([0-9]{1,2}) (January)>” in the “Find what” box, and
    • “\2 \1|” in the “Replace with” box,

    and click on “Replace All”.

  4. Change “January” to “February” and click on “Replace All” again.  Repeat for each month.
  5. Enter “|␣” in the “Find what” box and “,␣” in the “Replace with” box (where ␣ represents a space), and click on “Replace All”.
  6. Change the “Find what” box to just “|” (delete the space), delete the contents of the “Replace with” box, and click on “Replace All” again.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.