Page 1 of 1

Remove everything excep the last n characters

PostPosted: Wed May 28, 2014 1:37 pm
by EzMe
Ok, so I've been playing with this for a while. I got a couple of pictures with the following format:

867220140415210328.jpg
866820140415202327.jpg
50320140502211456.jpg

These are created this way: nYMDHMS where n is a random number and Y= year M= month D=day H= hour M= minute S= second

Now, I would like to do is

Step 1: remove everything except the time and date. So the last 12 characters before the .jpg need to stay.
Step 2: change YMDHMS.jpg into MDYHMS.jpg

Can this be done? Thanks in advance guys!

Grtz EzMe

Re: Keep only 12FinalDigits & re-order them

PostPosted: Mon Jun 09, 2014 10:42 pm
by truth
1Regex match/replace:
[0-9]+([0-9]{2})([0-9]{4})([0-9]{6})$
\2\1\3

To prevent affecting non-jpg's, you can use 12Filter=*.jpg
or just use the below 1RegexSettings:
[0-9]+([0-9]{2})([0-9]{4})([0-9]{6}).jpg$
\2\1\3
Include Ext.=checked

In either case, the regex wont touch previously renamed files (of only 12digits)

Re: Remove everything excep the last n characters

PostPosted: Wed Jun 18, 2014 2:32 pm
by EzMe
Thanks truth! Your solution worked our great!