Page 1 of 1

swap in book's name surname with first name

PostPosted: Mon Aug 09, 2021 3:09 pm
by naafrayu
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

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

PostPosted: Mon Aug 09, 2021 4:07 pm
by Luuk
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...
^([^, ]+), (.+?)( - .+)
^((?:(?! - )[^, ])+), (.+?)( - .+)