Swapping name order [regex] - problem with double names

Advanced Renamer forum
#1 : 03/08-17 09:54
Lena Freund
Lena Freund
Posts: 1
Hi guys,
I have a problem with identifying first name(s) and last name(s) accurately.

When I’m downloading students’ submissions from Moodle, the files created have the following format:
Firstname Lastname_12345_assignsubmission_file_Filename
Grading lists are sorted by last name, so the first part of the filename needs to change accordingly, unless you want to search for every student individually. Of course, it would be best to change the format within Moodle, but we cannot find the right spot.

So my idea was to rename the files after downloading using regex, swapping first name and last name and keeping the rest of the filename. Though I’m not a regex crack at all.

I tried this and it works for most names:
Match: ^([A-Z][a-z]*) ([A-Z][a-z]*) (.*)
Rename: /2 /1/3

Occurring problems: double first names or last names, e.g.:
• Marie Luise Meier
• Marie-Luise Meier
• Peter Müller-Schmidt
• Pedro Gonzalez Ferrera
• Anna von Hoff

Maybe a second regex?

Any help is much appreciated

03/08-17 09:54
#2 : 04/08-17 03:45
Posts: 35
Reply to #1:

So, all you are trying to do is flip the First name with the last name:
"Lastname Firstname_12345_assignsubmission_file_Filename"?

Do you need the conventional comma between the 2 names, or space (does it matter)?
Are you interested in an "Add Method" alternative that would involve separating the
3 part names from the 2 part names (hyphenated as single) and then combining them to
a single folder after renaming?

04/08-17 03:45 - edited 04/08-17 04:04
#3 : 05/08-17 15:22
Posts: 1
Reply to #2:

Hi, I'm new and was looking to see if my question was already answered. I would greatly appreciate any information on how to do the name switch. I would like comma and I don't mind separating if necessary. Filename sections are separated with dashes.

Thanks Much

05/08-17 15:22
#4 : 05/08-17 20:19
Posts: 35
Reply to #3:

MK wrote:
"Filename sections are separated with dashes."

To clarify before writing everything out, the example given by Lena Freund (aka MK?) above
has underscores separating the filename sections (sometimes colloquially referred to as a "low dash").
Are the "underscores" what you want, or simple "dashes"?

Or, did you mean to refer to the dashes in some of the names, like:

2 part ex.

Marie Meier
Marie Luise-Meier

3 part ex.

Marie Luise Meier
Marie Juliette Luise-Meier

05/08-17 20:19 - edited 11/08-17 21:23