#1 2020-10-18 01:39

Judge6ex
Member
From: Roatan. Honduras.
Registered: 2020-06-03
Posts: 4

Moving part of filename

I have a few thousand of files where I like to move the last 7 digits to the front of the file.
I searched here in the forum and tried some expressions but I must admit my experience with expressions are limited to bartalk over a cold beer.

So this is what I have:

Aerosmith - Dream On 029 -
Alice Cooper - School's Out 372 -
Allman Brothers Band - Whipping Post 242 -

This is what I like to have:

029 - Aerosmith - Dream On
372 - Alice Cooper - School's Out
242 - Allman Brothers Band - Whipping Post

Any ace up the sleve on how to do this in a jiffy?


A failed perfectionist that wont give up...

Offline

#2 2020-10-18 02:11

Judge6ex
Member
From: Roatan. Honduras.
Registered: 2020-06-03
Posts: 4

Re: Moving part of filename

THis is as close as I get. I think my main problem is that the info before what I like to move is different long from file to file so this method is most likely the wrong way to go.

First try
Second try
Third try


A failed perfectionist that wont give up...

Offline

#3 2020-10-18 08:24

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: Moving part of filename

You had good attempts, but I think Regular Expressions are better suited for this particular task.

Expression: \A(.*?)\s+([\d\-\s]+)\Z
Replace: $2$1

This will move all the trailing digits, spaces and dashes to the front of the filename.

Here is a demo:

renamer-topic2699-file1.png

For the reference:
https://www.den4b.com/wiki/ReNamer:Regular_Expressions

Offline

#4 2020-10-20 07:07

Judge6ex
Member
From: Roatan. Honduras.
Registered: 2020-06-03
Posts: 4

Re: Moving part of filename

Things are so much easier when you know what you are doing. Like in this case. Worked just perfect.
I lift my hat and say thank you!


A failed perfectionist that wont give up...

Offline

Board footer

Powered by FluxBB