I need some help with a renaming pattern

Post any Bulk Rename Utility support requirements here. Open to all registered users.

I need some help with a renaming pattern

Postby Pexr » Sat Nov 05, 2016 9:15 pm

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 !
Pexr
 
Posts: 5
Joined: Sat Nov 05, 2016 9:06 pm

Re: I need some help with a renaming pattern

Postby KenP » Sat Nov 05, 2016 9:39 pm

This will do what you want.

RegEx (1)
Match: ^(.*)(?:_)(\d{4}_\d{2}_\d{2})$
Replace: \2-\1
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: I need some help with a renaming pattern

Postby Pexr » Sat Nov 05, 2016 10:03 pm

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
Pexr
 
Posts: 5
Joined: Sat Nov 05, 2016 9:06 pm


Return to BRU Support