#1 2014-11-19 22:01

Transam563
Member
Registered: 2014-11-19
Posts: 2

"first name Surname" to "Surname, first name"

Ive found where this is addressed a couple of times, but the answeres appeared to be so I can understand them.

my specific question is this..changing..

First Name Surname - File Name.zip

                   To

Surname, First Name - File Name.zip

If anyone could give me the exact example of how to do this I would
appreciate it

PS This is absolutely a wonderful program smile

Offline

#2 2014-11-19 22:06

Transam563
Member
Registered: 2014-11-19
Posts: 2

Re: "first name Surname" to "Surname, first name"

If its in the same name, I know how to do it in "replace". The info request is if your names are different. Thanks

Offline

#3 2014-11-19 23:13

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

Re: "first name Surname" to "Surname, first name"

RegEx and Rearrange rules are your best friends for such tasks. You need to identify a pattern for separating 3 parts of your file names: First Name, Surname, File Name. But it's not clear how to identify Surname as it's not always just the last word.

Anyway, for simple cases this should work:
* RegEx: Replace expression "(.*) (.*?) - (.*)" with "$2, $1 - $3" (skip extension)

Input: First Name Surname - File Name.zip
Output: Surname, First Name - File Name.zip

Relevant help articles for RegEx and Rearrange rules:
* wiki/ReNamer:Rules:Rearrange
* wiki/ReNamer:Rules:Rearrange_Examples
* wiki/ReNamer:Rules:RegEx
* wiki/ReNamer:Regular_Expressions

Offline

Board footer

Powered by FluxBB