Tapatalk

Replacing Middle Initial

Replacing Middle Initial

2
NewbieNewbie
2

    Oct 21, 2006#1

    I'm trying to write a regualr expression to delete the middle initial in a flat file that also contains names without initials.

    Example:
    John C Doe
    Jane Doe

    Any help?

    206
    MasterMaster
    206

      Oct 21, 2006#2

      These might work, depending on what other text is in your file.

      Regular expression search, match case

      Unix Style:
      Search: ([A-Z][a-z]*) [A-Z] ([A-Z][a-z]*)
      Replace: \1 \2

      UltraEdit Style:
      Search: ^([A-Z][a-z]+^) [A-Z] ^([A-Z][a-z]+^)
      Replace: ^1 ^2
      Software For Metalworking
      http://closetolerancesoftware.com

      2
      NewbieNewbie
      2

        Oct 21, 2006#3

        Thanks! That works perferctly. Did I mention how much UltraEdit rocks!