#1 2024-07-04 18:11

chapyl
Member
Registered: 2024-07-04
Posts: 3

FirstLast -> LastFirst

I have many documents that follow the file structure FirstNameLastName[number], and I want to change them to LastNameFirstName[number]. How do I accomplish this change so that FirstNameLastName is instead changed to LastNameFirstName?

Offline

#2 2024-07-06 00:32

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: FirstLast -> LastFirst

Are there any spaces or punctuation marks anywhere in the filenames?

Currently, it looks like capital letters are the only workable delimiters for identifying first and last names.

Can you give some examples?

Offline

#3 2024-07-06 10:44

chapyl
Member
Registered: 2024-07-04
Posts: 3

Re: FirstLast -> LastFirst

For example, let's say I have the following files, now ordered as FirstNameLastName.

JamesSmith
KyleWright
AvaGreen
CharlesRoberts
DamianEdwards
OliviaWilson

I would like to reorder them to LastNameFirstName instead.

SmithJames
etc.

Renamer is fantastic in so many ways, allowing you to remove, add, and change file extensions. However, I haven't figured out if it's possible to change filenames where the only difference is the capital letter in the first and last names, and then reorder them accordingly. When I tested ChatGPT, it suggested something with a rule change in 'Regular Expression', but I couldn't get the proposed solution to work.

Offline

#4 2024-07-08 17:55

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: FirstLast -> LastFirst

You can use the Regular Expressions rule for this.

Expression: \A([A-Z][a-z]*)([A-Z][a-z]*)
Replace: $2$1
Case-sensitive: YES

This configuration assumes that your names are always in Latin alphabet (A-Z,a-z).

Offline

#5 2024-07-09 09:12

chapyl
Member
Registered: 2024-07-04
Posts: 3

Re: FirstLast -> LastFirst

Works perfectly. Many thanks! smile

Offline

Board footer

Powered by FluxBB