Extract filenames with 3 names from 2 names or viceversa

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
melsoft
Junior Member
Junior Member
Posts: 3
Joined: 2020-01-05, 08:10 UTC

Extract filenames with 3 names from 2 names or viceversa

Post by *melsoft »

Hello there,

I have a lot of books in a directory with names like this:

Benford, Gregory - Poveste de razboi.epub
Adrevon, Jean-Pierre - Jerod si pisica.doc

all together...i want to select only filenames with 2 names on authors from filenames with 3 names in authors name or viceversa and move in a separate directories.

Is there a possibility to do this using multi rename tool?

melsoft
Junior Member
Junior Member
Posts: 3
Joined: 2020-01-05, 08:10 UTC

Re: Extract filenames with 3 names from 2 names or viceversa

Post by *melsoft »

I want to select all files with 2 names on authors name and move from there to a "test" named directory, leaving all files with authors 3 names or more unmoved...

Benford, Gregory - Poveste de razboi.epub
Adrevon, Jean-Pierre - Jerod si pisica.doc

I put in italic red color the file selected...

PS: I can remove all the "quotes" sign from filenames...

Benford Gregory - Poveste de razboi.epub
Adrevon Jean-Pierre - Jerod si pisica.doc

Any solution???

User avatar
Stefan2
Power Member
Power Member
Posts: 2981
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Extract filenames with 3 names from 2 names or viceversa

Post by *Stefan2 »

2melsoft, hi and welcome!

I don't know right now, as "Jean-Pierre" is like one word too.

Are there really only names like
- Adrevon, Jean - Jerod si pisica.doc
- Adrevon, Jean-Pierre - Jerod si pisica.doc

or could there also be names like
- Adrevon, Jean Pierre - Jerod si pisica.doc
- Adrevon Second, Jean-Pierre - Jerod si pisica.doc
- Adrevon Second, Jean - Jerod si pisica.doc
- Adrevon Second, Jean Pierre - Jerod si pisica.doc
?





Then me think you can utilize search with [x]RegEx: \w+, [^-]+\w+ -

Explanation:
\w+, [^-]+\w+ -
\w+,  => match any char one-or-more till comma and space
[^-]+ => match any not-an-hyphen sign one-or-more
\w+ - => match any char one-or-more till space and hyphen


TEST:

On file names:
Adrevon Second, Jean - Jerod si pisica.doc
Adrevon Second, Jean Pierre - Jerod si pisica.doc
Adrevon Second, Jean-Pierre - Jerod si pisica.doc
Adrevon, Jean - Jerod si pisica.doc
Adrevon, Jean Pierre - Jerod si pisica.doc
Adrevon, Jean-Pierre - Jerod si pisica.doc



Finds for me:
Adrevon Second, Jean - Jerod si pisica.doc
Adrevon Second, Jean Pierre - Jerod si pisica.doc
Adrevon, Jean - Jerod si pisica.doc
Adrevon, Jean Pierre - Jerod si pisica.doc



And search with [x]RegEx: \w+, \w+-\w+ -
\w+,         => match any char one-or-more till comma and space
\w+-\w+ - => match any char one-or-more ; Hyphen ; any char one-or-more till space and hyphen
Finds for me:
Adrevon Second, Jean-Pierre - Jerod si pisica.doc
Adrevon, Jean-Pierre - Jerod si pisica.doc




Next utilize [feed to listbox]



Oh, it works doesn't matter how the names are composed, but may be wrong for your issue.

HTH?

melsoft
Junior Member
Junior Member
Posts: 3
Joined: 2020-01-05, 08:10 UTC

Re: Extract filenames with 3 names from 2 names or viceversa

Post by *melsoft »

Thank you for all detailed information! I managed to sort all my files looking in the first etape for files with only 2 names using this syntax:
\w+, \w+ -

:D

Post Reply