I have several files named YYYY-MM that I would like to rename as MM-YYYY.
What RENAME REGEXP would I use to accomplish this task?
I have several files named YYYY-MM that I would like to rename as MM-YYYY.
What RENAME REGEXP would I use to accomplish this task?
The RE pattern is (\d{4})-(\d{2}) and the replacement is \2-\1. But there is probably more required if you have additional pieces in the file name, and most likely a suffix. What are the full file names?
Is this using the standard DOpus Renamer or your Dynamic Renamer?
YYYY-MM is actually it for the file names right now. Ultimately, I want to get to one of these example states:
January 2010 Report
OR
January 2010 Sales Report
In essence:
I'm not sure this can be accomplished in one REG EXP. I'm sure it could be done in a script, just not sure exactly how yet. Still, with what you've suggested, I can make the first step then get through steps 2 and 3 fairly easily.
Regular expressions only match patterns, so don't have the ability to transform something like a date from one form to another.
If you're using Dynamic Renamer, the full transformation to accomplish what you want is:
-/(.*)/%%\1%%/ -d/%Y-%m/%B %Y Sales Report/
The -d transformation uses the strftime date template "%Y-%m" which is the YYYY-MM in your file names, and outputs a different date format of "%B %Y" followed by static text " Sales Report". A %B means full month name (in your current locale), and the %Y is the 4-digit year.
The initial substitution -/(.*)/%%\1%%/ just surrounds your date portion in your file with %% characters that -d requires (since dates could be anywhere in your file, and the -d transform needs to know where they are).
So those two transformations complete your job. You can save this as a Rename preset for future recall and use.
Works great... Thanks!