Basic Renaming Guide

This guide provides instructions and examples to help you get started with file/folder renaming using PFrank.

Setup

When you first start PFrank, there are 2 basic things you can set up before you start creating your renaming sequence. The first is the Current Folder and the second is the Name Filter.

Current Folder

The current folder determines where your files/subfolders will be renamed from. You can use the browse button to choose the folder, you can enter the full path manually into the text field, or the simplest way is to just drag the folder into the text field.

If you are unfamiliar with PFrank then it is highly recommended to create a test folder with copies of some of the names you want to change. Use the test folder as your current folder. Then follow the strategies outlined below to experiment on the names. Even if you are comfortable with your renaming skills you still might want to make a backup of all the original names in case something goes wrong.

Name Filter

The name filters are patterns used to determine what types of names to include or exclude. The patterns can be configured with regular expressions or wildcards depending on the pattern option configured using the options panel. Both regular expressions and wildcards are well defined formats (with some variations). The default format for name filters is wildcards. Some example wildcard expressions are:

Some example regular expressions are:

Regular expressions are more complicated than wildcards but they provide a much richer set of pattern matching features. More details on wildcards can be found in the wildcard chapter of the PFrank built-in Help. More details on regular expressions can be found in the regex chapter of the PFrank built-in Help or at reference links listed at the PFrank web site here.

Only names that completely match the filter will be selected. Partial matches will not result in a selection. e.g. a wildcard pattern set to '.mp3' will not match mymusic.mp3 but a wildcard pattern set to '*.mp3' will match it.
There are other many other filter options available.

Strategy

PFrank provides many ways to rename file/folder names. You can use the Insert buttons to either insert pre-defined patterns and then modify them or you can insert specialized commands.

Most renaming can be done using regular expression (regex) search patterns to match parts of or all of names and using regex replace patterns to substitute characters for the matched parts. The search and replace patterns are entered into the rows of the custom renaming list. Just double clock on a row to activate the editor and start typing. Unlike the search pattern used in the name filter in which the entire name has to be matched, the search pattern for name replacement only needs to match parts of the names. Each match in the name will be replaced. There is a way to limit the number of matches using special flags; this is detailed in the regex flags chapter of the PFrank built-in Help.

Sometimes the desired replacement can be done with 1 search/replace pattern. But more often you will require multiple rows. Just remember that the patterns are processed from first row to last. The output name of a row is used as the input to the next row (see Creating a Command Sequence)

To test your pattern sequence use the sample previewer. Just drag a sample name into the text field and watch how it changes as you adjust your patterns. To assist in debugging you can disable any row of the pattern using the checkboxes or you can add an exit command into the middle of the rows to disable the trailing patterns.

Right clicking on the custom renaming list will give you a popup menu with lots of options for manipulating the rows.

When you think your patterns/commands are ready, press the scan button. A preview window will pop up. Be sure to check all the rows of the preview to ensure the names are as you expect. You can manually edit any text in the new name column. If you don't like what you see, go back and adjust the custom renaming list, rescan, inspect, etc. When everything looks perfect, press the rename button to commit the changes. If after checking the folder, something did go wrong, there is one level of undo available.
An undo file is also automatically generated which you can import so that you can undo your last change anytime (even after restarting PFrank). Or you can automatically generate an undo file for every renaming operation so it would be possible to undo a series of renaming operations. It is advisable to try the undo feature beforehand in case you run into any problems. ie. during a test run create an undo file, perform the renaming, exit PFrank, restart PFrank, import the undo file, carry out the renaming to restore the original names, and then verify with an explorer window that the original names are back.

Right clicking on the preview list will give you a popup menu with lots of options for manipulating the list.

IMPORTANT: The example sequences below surround the search/replace patterns in single quotes. Do not enter the single quotes into the search/replace rows; they are only used in this web page for highlighting.
If you want to test the samples you can copy the Row/Search/Replace lines to the Windows clipboard (block select with the mouse and press Ctl-C), then select the PFrank main window with the mouse and press Ctl-F2. That will insert the search replace lines at the top of the custom renaming list!

String Substitution

Some example search replace patterns for text or string substitutions are:


Be careful with meta characters! For example, the following will lead to trouble: This will NOT remove all the '.'s that follow 'g'.
'.' is similar to a wildcard. This renaming will instead remove the character that appears after any 'g'. The proper way to remove the '.' is to first escape it either by preceeding it with a backslash as in '\.' or enclosing it in square brackets as in '[.]'. Check the examples below.

Number or Text Removal

Text removal is simply another form of string substitution but instead of replacing the search string with something, you replace it with nothing. This is done by leaving the replace pattern empty. Some example search replace patterns for number or text removal are:

Add Text

To add text you have to specify search strings as groups. Then in the replace pattern you reference the groups. Groups are formed by surrounding them with parentheses in the search pattern. e.g. The first set of parentheses is group 1 and is referenced by '\1'. A second group of parentheses would represent group 2 and is referenced by '\2'. Some example search replace patterns for adding text are:

Inserting Meta-Data

Renaming with Meta-Data is taking data obtained from within a file and using it to rename the file. For example if you have mp3 files you could rename the files by incorporating things like the artist name, song title, album name, etc into the name. Another example is if you have image files you can rename them according to the date/time, size or other information stored within the file.

If you want to insert music (e.g. mp3) or other meta-data into a filename, you have to go to the options window (from the main window, pull down the View tab from the top menu, and select 'Options...'. The options window will pop up. The left side of the window has a tree listing all the option categories. The right side lists the configurable options pertainng to the selected category.

For music files, select 'Music Information Insertion'. You'll see the insertion options come up on the right-hand side of the window. Use the 'custom format creator' to create the meta-data sequence to insert.

e.g. %Artist% - %Title%

The above will choose the artist name and title (separated by a dash) for insertion. You've now selected what to insert whenever you choose to insert music meta-data. You can set up similar configurations for other types of meta-data. Plus there are many more options which you can also configure for each type of meta-data.

Now you have to choose which meta-data to insert and where. Go back to the main window and pull down the pre-defined renaming list. You should see options to insert different types of information 'before' or 'after' and can combine that with 'all or prefix or extension' to insert the data within different parts of the name. Once you have chosen the insertion command, press the 'insert in list' button to insert the command into the custom renaming list. Below are some examples of search/replace rows for insertion of meta-data:

Creating a Command Sequence

If you want to perform more than one replacement, removal, addition, just create a sequence by specifying the different search/replae patterns in sequential rows. There is no limit on the size of the sequence! Some examples are below:

Saving/Loading Command Sequences

Once you have a command sequence or a partial sequence, you may want to save it for loading later on. This is easily done with the custom List Manager. The List Manager is available on the main window and lets you name the current sequence and save it (just press the save button!). When saved, the name of the sequence is stored in the drop-down list of the panel. A custom sequence can be loaded by using the List Manger to select the name corresponding to the sequence; then press the Load button! The saved lists as well as the current list are available even after restarting PFrank. This is in addition to your entire session which can be saved to different files for reloading at a future time.

For more detailed information on all features, the built-in Help of PFrank comprehensively describes everything. An Advanced Renaming section is also included.