replace booktitle and name

Advanced Renamer forum
#1 : 19/04-18 11:59
Rien
Rien
Posts: 6
I have a file with about 2000 e-books.
Content now is: booktitle – firstname lastname.epub
Examples:
the first time – miquel bulness.epub
black box – anna woltz.epub

Question: how do i get the following output:
the first name – bulness, miquel.epub
black box – woltz, anna.epub

Can you give me a helping hand?

Thanks in advance,
Rien


19/04-18 11:59
#2 : 19/04-18 12:24
Mark
Mark
Posts: 175
Reply to #1:
Hi,

Assuming that the form is ALWAYS booktitle – firstname lastname.epub (ie, using a single " - " to separate booktitle &firstname, and a space to separate firstname & lastname).....

Replace method
Text to be replaced: (.*)[ - ](.*)[ ](.*)
Replace with: \1 \3, \2 (note, the spaces and commas are important!)
Occurrence: All
Case sensitive: not ticked
Use regular expressions: ticked
Apply to: Name

My approach is to split the Name into 3 groups; up to the " - ", up to the space between the first and last names, and the rest (which is the lastname).

See how you get on. Others, better at RegEx than me, may give further advice.

HTH


19/04-18 12:24
#3 : 04/05-18 11:16
arwul
arwul
Posts: 94
Reply to #2:

Or maybe something like:

Find: (.+)[\s?\-\s?](.+)\s(.+)\.(\w{4})
Repl: \1 \3, \2.\4

from
the first time - miquel bulness.epub
black box - anna woltz.epub

into
the first time - bulness, miquel.epub
black box - woltz, anna.epub

this is about as far as I can get: have no regex knowledge either .. :-)


04/05-18 11:16