Delete first part of a name and put hashes

A swapping-ground for Regular Expression syntax

Delete first part of a name and put hashes

Postby the_Badluck » Sun Feb 10, 2019 1:01 am

I know this should be simple, but I can not figure it out. I want to use RegEx since I have the free version. I want to rename the files created by the camera on my phone.

IMG_20181024_133020020.jpg >>> 2018-10-24 at 13_30_20.jpg
IMG_20181024_134730384_HDR.jpg >>> 2018-10-24 at 13_47_30.jpg

I can do it with several passes by hand, but I have a boat load of files which are growing all the time. Thank you
the_Badluck
 
Posts: 1
Joined: Sun Feb 10, 2019 12:38 am

Re: Delete first part of a name and put hashes

Postby bru » Thu Feb 21, 2019 6:51 pm

Regex Match/Replace:
^IMG_(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(\d{2}).*
\1-\2-\3 at \4_\5_\6

Careful, this trims everything after the final _6Digits
bru
 
Posts: 16
Joined: Wed Jan 31, 2018 7:35 pm


Return to Regular Expressions