#1 2015-04-16 16:46

Howard98
Member
Registered: 2015-04-16
Posts: 2

From yyyy-m-d to yyyy-mm-dd?

How do I change yyyy-m-d to yyyy-mm-dd?  I don't have date on EXIF so I can't pull meta data from it.

Scenario 1:
ABC DEFG 2014-2-7.doc

New name:
ABC 2014-02-07 DEFG.doc

Scenario 2:
ABC DEFG 2013 5 3.doc

New name:
ABC 2013-05-03 DEFG.doc


Thank you for the hints!

Howard

Offline

#2 2015-04-16 18:21

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: From yyyy-m-d to yyyy-mm-dd?

Hi Howard, welcome!

FROM:
ABC DEFG 2014-2-7.doc
ABC DEFG 2013 5 3.doc

TO:
ABC 2014-02-07 DEFG.doc
ABC 2013-05-03 DEFG.doc

Based on that examples,
USE:
RegEx Rule
Expression: (.+) (.+) (\d\d\d\d).(\d).(\d)
Replace: $1 $3-0$4-0$5 $2


- - -

Explanation:
Match everything till an space >> (.+) >> store as group $1 >> 'ABC'
Match everything till an space >> (.+) >> store as group $2 >> 'DEFG'
Match 4 digits >>  (\d\d\d\d)  >> store as group $3 >> '2014'
Match one any sign >> .  >> don't store, drop >> '-'
Match 1 digit >> (\d)  >> store as group $4 >> '2'
Match one any sign  >>  don't store, drop >> '-'
Match 1 digit >> (\d) >> store as group $5 >> '7'

ABC DEFG 2014-2-7.doc
(.+) (.+) (\d\d\d\d).(\d).(\d)
$1 - - $2 - - $3 - - - -$4 - $5


Replace in wanted order, add zeros and hyphens on your own as need.

$1 $3-0$4-0$5 $2


.


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2015-04-16 19:44

Howard98
Member
Registered: 2015-04-16
Posts: 2

Re: From yyyy-m-d to yyyy-mm-dd?

Wow!  This is very detailed.  I really appreciate your help, Stefan!:)

Howard

Offline

Board footer

Powered by FluxBB