# Converters to rename files or to import tags

**URL:** https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016
**Category:** FAQ (Frequently Asked Questions)
**Created:** [February 28, 2009, 12:11pm UTC](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016 "2009-02-28T12:11:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 28, 2009, 12:11pm UTC](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016/1 "2009-02-28T12:11:39Z")

</div>

Mp3tag provides a variety of possibilities to get tag information from parts of the filename or rename files based on the information stored in the tag of a file.

The base concept behind all converters in Mp3tag is the so called format string, which describes a pattern (or template) of a filename or a line in a tag-list file.

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.

- [How to rename files based on tags (Tag to Filename)?](https://community.mp3tag.de/t/converter/8016/2)

- [How to create directory structures based on the tags and move the files (Tag to Directory)?](https://community.mp3tag.de/t/converter/8016/2)

- [How to import parts of the filename into the tag (Filename to Tag)?](https://community.mp3tag.de/t/converter/8016/3)

- [How to import parts of the folder structure into the tag (Directory to Tag)?](https://community.mp3tag.de/t/converter/8016/3)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 28, 2009, 12:15pm UTC](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016/2 "2009-02-28T12:15:57Z")

</div>

### How to rename files based on tags?

Renaming files, creating folders and complete directory structures from tags can be done by using the ![:mt_ttf:](https://community.mp3tag.de/uploads/default/original/1X/922db76db5d45b2e558d10f3d8c25fb8bc04fd27.png ":mt\_ttf:") Converter \> Tag - Filename with a format string. A 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 backslash `\` 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](https://docs.mp3tag.de/scripting) is used to ensure double-digit track numbers.

### How to create directory structures based on the tags and move the files?

When you're using a backslash in a format string, Mp3tag will create a directory from the part of the format string in front of a backslash.

Here is an example that creates new directories under `D:\Music`:  
`D:\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 below the current working directory:  
`%artist%-%year%-%album%\$num(%track%,2). %title%`

Please note, that the whole range of Mp3tag's [Scripting Functions](https://docs.mp3tag.de/scripting) can be used in the format string.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 28, 2009, 12:17pm UTC](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016/3 "2009-02-28T12:17:18Z")

</div>

### How to import parts of the filename into the tag?

Importing tags from filenames and directory names can be done by using the ![Converter > Filename - Tag](https://community.mp3tag.de/uploads/default/original/1X/6ab8d95b0c2a82cb4f9b0eb16ea87ad3a6575015.png "Converter > Filename - Tag") Converter \> Filename - Tag.

The basic concept is the notion of a format string which describes the structure of the name to import from. The format string is built of either standard text (e.g., `Music`), placeholders (such as `%artist%`, `%title%`, ...), or backslash characters `\` that denote directory structures.

Here is an example that imports tags from a file name `02. Four Ton Mantis.mp3`  
`%track%. %title%`

Please note how the format string completely resembles the structure of the file name.

### How to import parts of the folder structure into the tag?

It's also possible to import information from the directory structure of the file path where the backslash character is used to mark the different folders.

For example, the information from the path  
`Amon Tobin\[2000] supermodified\02 - For Ton Mantis.mp3`  
can be imported using  
`%artist%\[%year%] %album%\%track% - %title%`

Of course, sometimes it's also needed 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.
