swap in book's name surname with first name

Bulk Rename Utility How-To's

swap in book's name surname with first name

Postby naafrayu » Mon Aug 09, 2021 3:09 pm

Hi and thank you for this great tool.

Secondly, what is the proper regex(1) syntax which would allow swapping of first letter before "," with the next words up to the "-" ?
Or where can I find a comprehensive guideline in this respect?

I have a plethora of kindle books which i want to rename as such:

ORIGINAL:

Fox, Michael J. - Always Looking Up, The Adventures of an Incurable Optimist
Grafton, Sue - A is for Alibi
Abagnale, Frank W. - Catch Me If You Can
Card, Orson Scott - Ender 08 - Shadow of the Giant

BULK AFTER EDITING:
Michael J. Fox - Always Looking Up, The Adventures of an Incurable Optimist
Sue Grafton - A is for Alibi
Frank W. Abagnale - Catch Me If You Can
Orson Scott Card - Ender 08 - Shadow of the Giant


tks a lot!

Ayu / RO
naafrayu
 
Posts: 1
Joined: Mon Aug 09, 2021 3:03 pm

Re: swap in book's name surname with first name

Postby Luuk » Mon Aug 09, 2021 4:07 pm

For the examples, Im thinking to probably just use a 'Match' and 'Replace' like...
^(\w+), (.+?)( - .+)
\2 \1\3

But if its not working for all of the filenames, can experiment with different matches like...
^([^, ]+), (.+?)( - .+)
^((?:(?! - )[^, ])+), (.+?)( - .+)
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To