How do I make a folder on rename

I've got flat folders like this:

Aaron Dmitriew - Festival of Sound Soaring
Above & Beyond - Jam
Abstract Vision ft Hydro Poison - Orbiter
Activa ft. Julie Harrington - Away From This (Tim Bourne Remix)
Aeolu5 - Loarun
Aimoon ft Alaera - Summer Vibe
Alex M.O.R.P.H. - Starfleet Commander
Alex Mazel - Serenity

I would like to make a folder from the first part before " - " and make subfolder and put all contents to the subfolders.

Aaron Dmitriew \ Festival of Sound Soaring
Above & Beyond \ Jam
Abstract Vision ft Hydro Poison \ Orbiter
Activa ft. Julie Harrington \ Away From This (Tim Bourne Remix)
Aeolu5 \ Loarun
Aimoon ft Alaera \ Summer Vibe
Alex M.O.R.P.H. \ Starfleet Commander
Alex Mazel \ Serenity

Is this somehow possible?

I tried as below, but it apparently yields no result:

Escape the backslashes: \\

The inputs to the rename function are always just filenames. Your "old name" pattern won't match anything because it has a backslash in it, as if it were expecting a folder name as well as the input.

Try this:

Old name: (.*)\s*-\s*(.*)
New name: \1\\\2

Already tried, didn't work.

Just tried your proposal, reports error:

Try

Parameters for the Advanced Renamer
Mode: Regular Expressions + Find And Replace
Old name: (\.| )*-(\.| )*
New name: \\
Ignore extension: checked
Automatically rename if new filename exists: checked
1 Like

Sorry, I should have tested it obviously! The problem is that the first (.*) was grabbing the space before the hyphen, and folder names can't end in a space (or a period, come to that).

Try this instead:

Old name: (.*?)[\s\.]*-\s*(.*)
New name: \1\\\2

1 Like

This is working. Thanks. :slight_smile:

This is working, too. Thanks. :slight_smile:

You guys mark "solution" whichever of the two posts. I couldn't decide. :slight_smile:

As the one that wrote the original post, you're the only one that can mark the solution. (Although, I'm sure Jon or Leo could do so, I don't think they would.)

I'd give it to Lxp just because he answered first. :slight_smile:

Both guys were good. Saved my time. When it comes down to RegExp I start having headaches. I've studied them dozens of times and forgot all about them the moment I used them. It's not that you need to use them on regular basis. I even used them with SQL statements and it's just the same - you need them when all other possible solutions fail. :slight_smile:

Solution credits don't convert into cash or anything :smiley:

1 Like