Firstname Lastname to Initial Lastname

Bulk Rename Utility How-To's

Firstname Lastname to Initial Lastname

Postby Ixion73 » Fri Nov 17, 2023 11:54 am

I'm Sorry if this has been asked for before.

But I just need to rename 2000 files with Initial Lastname

Someone sent me a bunch of files that currently have Firstname Lastname
Ixion73
 
Posts: 4
Joined: Fri Nov 17, 2023 11:47 am

Re: Firstname Lastname to Initial Lastname

Postby Admin » Fri Nov 17, 2023 12:04 pm

Hi, what is the separator? Do you have some examples?
Admin
Site Admin
 
Posts: 2662
Joined: Tue Mar 08, 2005 8:39 pm

Re: Firstname Lastname to Initial Lastname

Postby Ixion73 » Fri Nov 17, 2023 12:05 pm

Hi Sorry the only seperator is a space

So like
John Smith
William Bragg
Judith Chalmers

And so on
Ixion73
 
Posts: 4
Joined: Fri Nov 17, 2023 11:47 am

Re: Firstname Lastname to Initial Lastname

Postby Admin » Sun Nov 19, 2023 10:24 am

Hi, you can swap around space using:

RegEx (1)
Enable option "Simple" in RegEx (1)
Match: %1 %2
Replace: %2 %1

However if the first name contains a space it will not work properly.
Admin
Site Admin
 
Posts: 2662
Joined: Tue Mar 08, 2005 8:39 pm

Re: Firstname Lastname to Initial Lastname

Postby Ixion73 » Mon Nov 20, 2023 6:37 am

Hi

Thanks for this reply, this just swaps first and last name.

I need Joe Bloggs to turn into J Bloggs

TIA
Ixion73
 
Posts: 4
Joined: Fri Nov 17, 2023 11:47 am

FirstName LastName --> FirstInitial LastName

Postby Luuk » Mon Nov 20, 2023 8:05 am

With leaving the checkmark inside for "Simple", could try something like...
%1%2 %3
%1 %3

Without the checkmark, could also try something more complicated like...
^(.)[^ ]+( [^ ]+)$
\1\2
Luuk
 
Posts: 771
Joined: Fri Feb 21, 2020 10:58 pm

Re: Firstname Lastname to Initial Lastname

Postby Ixion73 » Mon Nov 20, 2023 10:34 am

This worked perfectly

Thanks
Ixion73
 
Posts: 4
Joined: Fri Nov 17, 2023 11:47 am

Re: Firstname Lastname to Initial Lastname

Postby therube » Tue Nov 21, 2023 5:22 pm

%1%2 %3
%1 %3

Took me a moment to realize what you were doing there.
(And it was something I'd not thought of.)
therube
 
Posts: 1393
Joined: Mon Jan 18, 2016 6:23 pm


Return to How-To