Page 1 of 1

I need some help with a renaming pattern

PostPosted: Sat Nov 05, 2016 9:15 pm
by Pexr
Hello everyone,

I have a considerable number of files which names look like this :

abcdefgh, abcdefgh_abcdefgh_1_2016_09_22.docx

I'm looking for a way to transform the name into :

2016_09_22-abcdefgh, abcdefgh_abcdefgh_1.docx

In other words, i need the date to be before the rest of the informations.

ps : The 2016_09_22 is just an example, the format stays the same but the years, months and days change.

Thanks !

Re: I need some help with a renaming pattern

PostPosted: Sat Nov 05, 2016 9:39 pm
by KenP
This will do what you want.

RegEx (1)
Match: ^(.*)(?:_)(\d{4}_\d{2}_\d{2})$
Replace: \2-\1

Re: I need some help with a renaming pattern

PostPosted: Sat Nov 05, 2016 10:03 pm
by Pexr
Woah, it works. Regular expression are definitely the closest thing to magic ! (my feeling anyway !)

Thanks a lot KenP, i have no idea who you are, where you are or what you stand for but this helped me a lot and i'm reall grateful !!

Cheers