# Best way to handle multiple format strings

**URL:** <https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247>\
**Category:** Support\
**Created:** [November 27, 2021, 4:04am UTC](https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247 "2021-11-27T04:04:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry56](https://community.mp3tag.de/user_avatar/community.mp3tag.de/henry56/32/10315_2.png) [@Henry56](https://community.mp3tag.de/u/Henry56)\
**Post date:** [November 27, 2021, 4:04am UTC](https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247/1 "2021-11-27T04:04:44Z")

</div>

What is the best way to handle the situation where you want to create tags from file names but the set of open files cannot be handled by a single format string? For a simple example, suppose some of the files are  
Artist - Title  
but others are  
Title by Artist  
I can create two different format strings in the history and then select the one that matches one file at a time. But I’d really like to process all the files at once, and have mp3tag pick the format string that matches each, by trying the first format string, then the second, etc, until one is matched.  
I’m new to mp3tag but since the program has been around so long I have to think many others have thought about this and hopefully found a solution!

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [November 27, 2021, 5:41am UTC](https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247/2 "2021-11-27T05:41:17Z")

</div>

The best way is to filter the files for typical sequences that match a format string, marl all files in the result and then apply the coverter Filename-\>Tag. The Preview helps to control the result.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 27, 2021, 8:09am UTC](https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247/3 "2021-11-27T08:09:29Z")

</div>

On top of the advice that @poster gave, I would like to add some philosophy:  
The filename is an unstructured string - and assigning bits of the string to fields imposes a structure on the available data.  
MP3tag cannot read and therefore it only relies on the pattern structure that you define. How should a program tell that, taking your example, the first part is the artist in one case and the title in the other.  
So it is a different pattern that has to be treated differently.

As @poster suggested: filter for the patterns, e.g.  
%\_filename% HAS " by "  
or  
%\_filename% HAS " - "

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:29pm UTC](https://community.mp3tag.de/t/best-way-to-handle-multiple-format-strings/55247/4 "2026-02-09T12:29:32Z")

</div>


