The base concept behind all converters in Mp3tag is the format string, which describes a pattern or template of a filename.
A format string consists of any characters and predefined placeholders or scripting functions. Every placeholder begins with the percent sign %
, followed by a tag field name and ends with the percent sign.
For example, the placeholder %album%
refers to the Album
field.
Learn more about format strings in Format Strings and Available Placeholders and scripting functions in Scripting Functions
Rename Files
Rename Files based on Tags
Renaming files, creating folders and complete directory structures from tags can be done by using Convert → Tag - Filename with a format string. The format string is used to describe the structure of the desired filename.
Besides using normal placeholders (such as %artist%
, %title%
, ...) and arbitrary text (e.g., Music
) it also allows for separating folders with the slash /
character.
Here is an example that renames the file based on the tags using the Tracknumber. Title
format:
$num(%track%,2). %title%
Please note, that the
$num
scripting function is used to ensure double-digit track numbers.
Create Folder Structures based on Tags
When you're using a slash character /
in a format string, Mp3tag creates a folder from the part of the format string in front of a slash.
Here is an example that creates new directories under ~/Music/
:
~/Music/$left(%artist%,1)/%artist%-%year%-%album%/$num(%track%,2). %title%
The same is also possible using relative path names (instead of an absolute path in the example above) which creates the new directory relative to the file the converter is applied to:
%artist%-%year%-%album%/$num(%track%,2). %title%
Import Tags from Files
Import Parts of the Filename to the Tag
Importing tags for filenames and directory names can be done by using Convert → Filename - Tag.
The format string describes the structure of the name to import from. It is built of either standard text (e.g., Music
), placeholders (such as %artist%
, %title%
, ...), or slash characters /
that denote folder structures.
Here is an example that imports tags from a file name 04. My Friend the Forest.mp3
%track%. %title%
Please note how the format string completely resembles the structure of the file name.
Sometimes you might want to omit some information that should not imported to the tag. This can be done using the
%dummy%
placeholder for the unneeded part of the file path.
Import Parts of the Folder Structure to the Tag
It's also possible to import information from the directory structure of the file path where the slash character is used to mark the different folders.
For example, the information from the path
Nils Frahm/[2018] All Meldoy/09 - Momentum.mp3
can be imported using
%artist%/[%year%] %album%/%track% - %title%