Wish to change filename by deleting 26 characters

Bulk Rename Utility How-To's

Wish to change filename by deleting 26 characters

Postby William1656 » Sun Oct 17, 2021 12:23 pm

Can anyone help please with the following ?

My image files have all been renamed by the Windows Backup utility, so that a file named "20180714 Paris001.jpg" has now become:
"20180714 Paris001 (2021_08_03 14_51_22 UTC).jpg"

How do I delete the 26 characters to the left of the dot ?
I need to do this for several hundred files. I can put the files into the Bulk Rename Utility dialog page ok but I'm not sure which of the boxes to check, what to enter in the various boxes etc.

Thanks.
William1656
 
Posts: 1
Joined: Sun Oct 17, 2021 12:13 pm

Remove last 26 characters

Postby Luuk » Mon Oct 18, 2021 2:22 am

To remove any last 26 characters, can use Filters(12) with 'Name Min'==27, then also Remove(5) with 'Last n'==26.
Also with using the Regex(1), this some different ways using 'Match' and 'Replace' to conduct the same...

Remove any last 26 characters...
(.+).{26}$
\1

Remove the last 26 characters if they start with ' (' and end with ')'.
(.+) \(.{23}\)$
\1

Remove the last 26 characters if they are much like the example date.
(.+) \(2021_\d\d_\d\d \d\d_\d\d_\d\d UTC\)$
\1
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm

Re: Wish to change filename by deleting 26 characters

Postby Admin » Tue Oct 19, 2021 7:51 am

If the format is always :

<characters><space>(<timestamp>).jpg

then you could also use,

RegEx (1)
Match : %1 (%2)
Replace: %1
Simple: enabeld

This will truncate anything with a space followed by text between ( )
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To


cron