Moving part of file name to front

Bulk Rename Utility How-To's

Moving part of file name to front

Postby drakkura » Mon Apr 07, 2025 3:43 pm

Hi all,

Love the program, it's so useful! I've done a quick search to try and find what I'm looking for without any luck. I've got a whole bunch of files I want to move a particular part to the front of the file name. The files contain the word IMG with a 4 digit number after it in random spots of the file name. The number is different but IMG is the same. I want to try and move the part of IMG and the number to the front. I was hoping it was as easy as finding the IMG number and moving it but I've been unable to successfully do it.

For example:

it might be AAAA BBBBB IMG1000
or AAAA BBBBB CCCCC DDDDD IMG1021 EEEE
or even AAAAA BBBB CCCC DDDDD EEEE IMG1041 8.10.2019
It's random!
Hopefully it can be done!
drakkura
 
Posts: 1
Joined: Mon Apr 07, 2025 3:37 pm

Re: Moving part of file name to front

Postby TheGhost78 » Mon Apr 07, 2025 9:06 pm

Use RegEx (1) and tick v2.

Match:
^(.*?)(?:\s+)?(IMG\d{4})(?:\s+)?(.*)$(?X)\s*$

Replace:
$2 $1 $3(?X)
TheGhost78
 
Posts: 173
Joined: Fri Jul 19, 2024 11:25 am

Re: Moving part of file name to front

Postby TheGhost78 » Mon Apr 07, 2025 9:09 pm

You can use ChatGPT to ask for RegEx suggestions to do whatever rearranging you need. Just be very clear and give examples of the current filenames and what you want them to become.
TheGhost78
 
Posts: 173
Joined: Fri Jul 19, 2024 11:25 am


Return to How-To