Renaming with Metadata

You can use metadata (information about a file) to build up the new names of files by using various metadata insertion codes in the new name field.

 

    Renaming with Metadata.png 

 

In this example we can see that the original names of the MP3 files gave no information as to their content (01.mp3, 02.mp3, etc). Luckily, MP3 files usually contain metadata describing the music. Not only are we are using this metadata to rename the files, but we are using it to actually organize the music into folders.

 

Click the drop-down button to the right of the New name field to display a list of all the metadata fields that Opus supports.
 

    rename_metadata_menu.png

 

These are the same fields as you can add to the file display as columns. When you pick a column from this menu (or one of the special, rename-only, options that appear at the bottom of the menu), the appropriate code is automatically inserted into the new name field at the current cursor position.

 

In the above example, we are using four music-related fields:

 

The back-slashes that we have inserted between these fields has the effect of moving the file into sub-folders (relative to the current folder) as well as renaming it. The sub-folders will be created automatically if they don't already exist.

 

The Keywords for Columns page contains a full list of the keywords that can be used by the Rename function.

 

As well as the full list of columns, the following codes can be used in the new name field:

The {parent} and {parentbase} codes can also strip the file extension from the parent name, which is usual if the parent folder is an archive file. To do this, add |noext to the code (e.g. {parentbase|noext}).

 

If you want to use rename to move files into new folders, adding $.\ at the start of the new name lets each file be moved relative to the base folder rather than its parent.

 

Sometimes metadata may contain characters that aren't valid in filenames. For example, the {time} field normally formats the time using colons (HH:MM:SS), and colons are not legal filename characters. By default illegal characters will be converted to the closest legal alternative (so for example, a colon will be converted to a semi-colon). However you may wish to control this process yourself:

If for some reason you want to include a metadata code in the new filename literally (e.g. you really want to call a file Blah{size}) you can escape the leading { with another { character. E.g. *{{size} as a new name would add the literal string {size} to the name of every file.