View Single Post
 
Old 06-25-2019, 09:50 AM
cheech1981 cheech1981 is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Nov 2011
Location: New Jersey, USA
Posts: 77
cheech1981 is on a distinguished road
Default Reversing Word Order with Multiple String Types

Hi all,

I am doing a find/replace to reverse the first initial and last name in a list, like this:

J. Smith --> Smith, J.

I've got that down with:
Find: <([A-Z][! ]@) ([A-Z][! ]@)>
Replace: \2, \1

However, I quickly stumbled across a challenge. Some names have both a first and middle initial, such as

R. M. Johnson --> Johnson, R. M.

Is there a single find/replace query I can run that would account for both types of names (names with just a first initial and names with both first and middle initials)?

Thank you for any ideas you can provide!
Reply With Quote