Rename into sub-folders (example in body)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Zefrem23
Junior Member
Junior Member
Posts: 7
Joined: 2013-05-12, 09:02 UTC

Rename into sub-folders (example in body)

Post by *Zefrem23 »

I have several thousand files that are name, for example,

Arrow.Book1.epub
Arrow.Book2.epub
Penguin.MyTitle.epub
Penguin.AnotherTitle.epub
Baen.SomeonesBook.epub

I would like to use the multi-rename tool and a regex (if necessary) to rename the files into subfolders as follows:

[ARROW]
Book1.epub
Book2.epub

[PENGUIN]
MyTitle.epub
AnotherTitle.epub

[BAEN]
SomeonesBook.epub

So in other words I want to use the first part of the filenames as the subfolders into which to move the files.

My regex picks up the first part no problem

(^[a-zA-Z0-9 ,-]{3,40}\.)

But in the 'replace with' field, if I put in a backslash or a forward slash (to create the path for the subfolder) then the rename fails - it seems the slashes are illegal characters for this.

So I'm asking, is there a way to do this with the multi-rename tool out of the box, or will I need to look elsewhere?

Thanks in advance, you forum folks are awesome!
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Which TC version do you use?
TC 8.01 allows replacing (^[a-zA-Z0-9 ,-]{3,40})\.(.*) with $1\\$2 w/o any problems and creates missing directories.
Zefrem23
Junior Member
Junior Member
Posts: 7
Joined: 2013-05-12, 09:02 UTC

Post by *Zefrem23 »

Well I'll be darned - the new version does exactly what I need :D

Thanks!
Post Reply