change month to number

A swapping-ground for Regular Expression syntax

change month to number

Postby oab2 » Wed Nov 06, 2013 8:18 pm

Currently my files are all named with the same format and length of characters. Ie 01Aug2012-065328.log

I would like to change the month abbreviations to its number. so Aug would become 08. This is essentially going from type %b to %m. I am also rearranging this file's name as well so I would love to have this all in one step.

I currently have:
Code: Select all
Match: (.{2})(.{3})(.{4})(.+)
Replace: \3-\2-\1\4

So the above converts to: 2012-Aug-01-065328.log
I would like it to ultimately read: 2012-09-01-065328.log I have thought of taking 2 steps and that is ok if that would be the easiest. I could have the rearrange as the first rename step but I don't know how to convert the month for the second rename step.

Any help would be appreciated.
oab2
 
Posts: 1
Joined: Wed Nov 06, 2013 8:06 pm

Re: change month to number

Postby Stefan » Wed Nov 06, 2013 9:42 pm

oab2 wrote:I don't know how to convert the month to corresponding numbers

Aug > 08
Sep > 09





You can utilize "Character Translations".

Read the help or that HowTo >>> http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=4&t=1329





Please wait a few seconds then submit. Thank you.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions