Duplicating existing filename content

Bulk Rename Utility How-To's

Duplicating existing filename content

Postby elmouseyo » Tue Jun 27, 2023 6:38 am

I have a weird one that I cant figure out, check to see if this is possible.

I need to duplicate an existing filename and add a block of text between the two duplicates. ie.

current
example1.jpg
example2.jpg

Needs to change to
example1NEWTEXTexample1.jpg
example2NEWTEXTexample2.jpg

Is this possible?
elmouseyo
 
Posts: 1
Joined: Tue Jun 27, 2023 6:34 am

Duplicate name with text inbetween

Postby Luuk » Tue Jun 27, 2023 6:49 am

Inside of RegEx(1), the "Match" and "Replace" can be like...
(.+)
\1NewText\1
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: Duplicating existing filename content

Postby therube » Tue Jun 27, 2023 6:02 pm

Along the same lines, but perhaps a bit easier to "think about".

1:RegEx, enable Simple
Code: Select all
Match:  %1
Replace:  %1----whateveriwanthere---%1

%1 (in this case) [simply] matches everything (the same as does (.+))
& with that, simply duplicate the %1, & add whatever i want there (or not), in between (or elsewhere)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm


Return to How-To