Custom Upperacase and Lowercase
While the program does not support it directly, case can be changed using the Full Regular Expressions option (starting in v3.9).
\L1 inserts lowercase for the first backreference
\U1 inserts uppercase for the first backreference
---
[Examples]
Find and Replace: ^(.)
With: \L1
This will find the first character and replace it with a lowercase.
Find and Replace: ([A-Z])([a-z])
With: \1\U2
This will find all instances of an uppercase letter followed by a lowercase letter and replace only the second character with an uppercase letter.
Renaming using Case Sensitive options
RM is designed to be case insensitive, meaning "C" and "c" are treated the same. As a workaround, RM can use the Full Regular expression option under "Case & Wildcards". This options lets you define a group of characters.
As an example, a user wanted to add a space in front of any capital letter for a name like the following: ThisIsAnExampleOfWords. Using the phrase "[A-Z]", without the quotes, is a substitution group that means any uppercase letter. Using the Add Before/After step, you can easily add a space before the phrase "[A-Z]". While this works for the most part, it doesn't account for many unwanted cases.
Using the new Find and Edit step, the phrase "[a-z][A-Z][a-z]" can be searched for and a space can be inserted in position 2. This phrase is very specific. The preceding letter must be lower case, the target letter must be upper case followed by a lower case letter. These rules means the letter cannot be at the beginning or ending of the name, and must be a single capital letter.
These names do not apply:
Spaces and dashes-In The Name Already
TOOmanyCAPITALletters
These names...
OnlySingleCapitals
SOMENamesWillBeSeparated
will become:
Only Single Capitals
SOMEName Will Be Separated
Random Numbers
In this example, the user wanted to insert a random number at the beginning of the filename. Most of the time, usually this is just a work-around for really poor programs or devices that don't have a Shuffle function. Rarely, I've seen a few cases where this is to remove filename collisions.
While RM does not currently have a random number meta-variable, you can fake it with a quazi random number. By inserting just the seconds part of the time from a date, this is most likely close enough for most cases - except if you copy all the files to the computer at one time. You can, however, also use the lowest numbers form the size of the file to also make a seemingly random number since the least significant bits will be much more varied.
The following variables will insert the Date-Modified and Date-Created formatted as only second:
?dmo:Fss? ?dc:Fss?
The ?zn? meta-variable for file size can be inserted into the beginning of the filename. Using the Substring formatting option, you can show only the last three digits when the file is seven digits in length in the following example :
?zn:S4.7? - where only characters 4 through 7 will be shown
Moving parts of the filename
NOTE: Newer versions of RM contain a 'Split and Move', a 'Select and Move', and a 'Swap' step that aid in moving parts of the filename around. The method below should only be used if the above steps aren't flexible enough.
I've often been asked how to move parts of the filename. In this section, I'll describe the process, but leave out an actual example.
The way Rename Master (RM) performs moving parts of the filename is by using a cut-and-paste procedure, or more accurately, a remove-and-add procedure. RM has a special meta-variable called ?temp?. On most remove operations, there is and option to store the removed text in the ?temp? variable. By inserting an Add operation after the Remove, the ?temp? variable can now be place in the textbox for the text to be inserted.
While this operation isn't very intuitive, it's extremely flexible. Every possible combination of Remove and Add is available for moving strings around in the filename. For the most flexibility, I recommend using the Remove Expression Step (found in newer version of RM).
For an example, if you wished to rename a file named after the date in MMDDYYYY format to YYYYMMDD for sorting, you'd only need to remove the last 4 numbers from the end of the filename and Add the removed text to the beginning of the filename. The Remove Beginning/Ending Step and the Add to Beginning/Ending Step will perform this task easily.
Insert the Month Name
In this example, the user wanted to insert the month name after the date in numeric format. Below is a list showing how the operation should work:
Before:
file1 20100131 sgelse.ext
file1 20100228 sgelse.ext
file1 20100331 sgelse.ext
After:
file1 20100131 Jan sgelse.ext
file1 20100228 Feb sgelse.ext
file1 20100331 Mar sgelse.ext
Since the date is formatted in YYYY MM DD format, the Add Before/After step can be used to do the operation using a single script with 12 steps [one step for each month name]. Starting with a blank Scripting tab, add the Add Before/After step 12 times and use the following settings for the first Step:
Add [ Jan] to the [Name]
place it [After] [201001??]
This will add a space and the word Jan to any file that contains 201001 followed by any two characters. Think of this as a Search and Insert operation. The ?? part stands for any 2 characters, so it will incorrectly turn [201001AB] into [201001AB Jan]. This isn't a perfect operation, but it will work most of the time.
The following settings be used for February:
Add [ Feb] to the [Name]
place it [After] [201002??]
The same format is used for March through December. Once all 12 steps have been set, this can be saved as a script file for future use. As said above, this isn't perfect, so it's important to scan the New Name column, make sure the results are as expected, and uncheck any files that should not be renamed before doing any renaming.