Trying to move numeric string to beginning of filename

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

Trying to move numeric string to beginning of filename

Postby ShailendraSham » Thu Jan 17, 2019 8:18 pm

Greetings all :) :)

I'm trying to get used to the expressions (the last time that I coded anything was with Turbo Pascal in 1995 :oops: ) and not getting very far..

I have a large number of research articles over many years most of which are in PDF format. They are mostly saved with filenames in the format:

"Figuring out Bulk Renaming - TGRMN 2018" and
"Figuring out Bulk Renaming - TGRMN - 2018"

I am trying to rename them to the format: "2018 Figuring out Bulk Renaming - TGRMN"

The year (eg 2018) is mostly the last four characters of the existing filename but not always.

Is there a quick way that I can get this done with BRU?
Even if I can automate most of the process, it would be better than literally renaming every one using explorer....

Thanks in advance!!
ShailendraSham
 
Posts: 1
Joined: Thu Jan 17, 2019 6:49 pm

Re: Trying to move numeric string to beginning of filename

Postby Emerkamp » Fri Jan 18, 2019 1:03 am

Hi,

This might have to be a more strict code since they might not have the same pattern, or done in 2 steps. You can try this, it should work as long as four digits are always after a space. You may need to trim the ends in a 2nd step also. A trailing - will be left on some.

RegEx (1)
Code: Select all
Match:
(.*)\s(\d\d\d\d)
Replace:
\2 \1

If you can add a better Break thats common before your digits, I can give you a better code. EX __ double underscore.
Check to see its ok before renaming. Hope it helps.
Emerkamp
 
Posts: 140
Joined: Sat Aug 23, 2014 2:35 pm


Return to BRU Support


cron