Move First Two Words to End of Filename

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

Move First Two Words to End of Filename

Postby Videoman22 » Tue Jul 09, 2019 10:39 pm

I search the forum and couldn't find a solution to my problem. I have filenames that are formatted as follows

Jane Smith-1-2019
Jack Smith-5-1-2019
Thomas Smith-6-2019

My goal is for them to look like the following
1-2019-Jane Smith
5-1-2019-Jack Smith
6-2019-Thomas Smith.

So basically move everything before the first "-" to the end of the filename and insert another "-" or space.

Does anybody know how I might be able to do this? Thanks.
Videoman22
 
Posts: 4
Joined: Fri Mar 20, 2015 3:37 pm

Re: Move First Two Words to End of Filename

Postby therube » Wed Jul 10, 2019 2:08 am

So basically move everything before the first "-" to the end of the filename and insert another "-" or space.


1:RegEx
Code: Select all
Match:  (.*?)-(.*)
Replace:  \2-\1


non-greedily match anything up to the first dash (-), \1, then match everything else, \2
reverse their positions, with a dash between
therube
 
Posts: 567
Joined: Mon Jan 18, 2016 6:23 pm

Re: Move First Two Words to End of Filename

Postby Videoman22 » Wed Jul 10, 2019 6:56 pm

That worked perfectly. Thanks for the help.
Videoman22
 
Posts: 4
Joined: Fri Mar 20, 2015 3:37 pm


Return to BRU Support