Rename Months to Numbers

I want to rename files with month names to month numbers. How would I do this in the DO12 Rename Dialog?

Using a rename script would probably be the best way.

Can you give some before & after examples of the exact date formats involved and other filename details?

Chuck,

Since you have Dynamic Renamer installed, you can do this already:


However, you need an update to handle one case which I wasn't handling correctly. The 1.13 version is attached here for your convenience. Let me know how this works for you.

For date component specifications, search Google for Date::Manip::Date and search in that manual page for PRINTF DIRECTIVES.
_Dynamic Renamer 1.13.zip (7.42 KB)

[quote="leo"]Using a rename script would probably be the best way.

Can you give some before & after examples of the exact date formats involved and other filename details?[/quote]
Leo, here are a few examples:

January 2016 Budget Report
Jan 16 Budget Report
Budget Report January 2016
Budget Report Jan 16

I want to rename those all as 2016-01 Budget Report

MrC, thanks for this. I'm interested in another way that's strictly DOpus/scripting.

Hey Chuck,

No problem, I understand. Its a non-trivial problem, because month names can be many variations, in various locations within the filename, and in languages other than English. Furthermore, it can be difficult to distinguish a month name from the non-date portion of the filename, so you have to use some sophisticated algorithms to deduce what is a valid date, so that you can separate it from the non-date portion.

Good luck!

Besides MrC's very handy Dynamic Renamer, any script-based suggestions to rename the following examples to YYYY-MM File Name:

January 2016 File - rename as 2016-01 File
Jan 16 File - rename as 2016-01 File
File January 2016 - rename as 2016-01 File
File Jan 16 - rename as 2016-01 File

Appreciate any insight!