# Help with Convert: Filename to Tag

**URL:** <https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339>\
**Category:** Support\
**Created:** [October 1, 2020, 7:53pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339 "2020-10-01T19:53:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![santanera](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@santanera](https://community.mp3tag.de/u/santanera)\
**Post date:** [October 1, 2020, 7:53pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/1 "2020-10-01T19:53:27Z")

</div>

I have music files that are names as follows:

la-sonora-santanera-XXXXXXXX.mp3

The Artist name is: La Sonora Santanera  
The Song Title is: XXXXXXX (sometimes if the name of the title is 2 or 3 words, the filenames use "-" as the separator. e.g "la-sonora-santanera-feliz-cumpleanos.mp3")

How can I create the tags using that filename structure I cant get it to work.

---

<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:** [October 1, 2020, 8:06pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/2 "2020-10-01T20:06:30Z")

</div>

> [@santanera](#):
>
> la-sonora-santanera-XXXXXXXX.mp3  
> la-sonora-santanera-feliz-cumpleanos.mp3

This is more or less hopeless as you do not have any kind of decent separators between the data parts.  
So to get that working somehow, you would have to prepare the filenames somehow.  
I suggest the following:  
First filter for files with a decreasing number of hyphens in the filename with  
`%_filename% MATCHES .*-.*-.*-.*-.*`  
This should show files like  
`la-sonora-santanera-feliz-cumpleanos.mp3`  
Now use the function Convert Filename-Filename with  
Mask over source filename: %1-%2-%3-%4-%5  
Mask over target filename: %1 %2 %3\_%3 %4  
Then import the data with  
Convert\>Filename-Tag  
Format string: %artist%\_%title%

Now filter for files with one hyphen less:  
`%_filename% MATCHES .*-.*-.*-.*`  
This should show files like  
`la-sonora-santanera-XXXXXXXX.mp3`  
Now use the function Convert Filename-Filename with  
Mask over source filename: %1-%2-%3-%4  
Mask over target filename: %1 %2 %3\_%4  
Then import the data with  
Convert\>Filename-Tag  
Format string: %artist%\_%title%

---

<div class="post-metadata">

**Author:** ![santanera](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@santanera](https://community.mp3tag.de/u/santanera)\
**Post date:** [October 1, 2020, 8:17pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/3 "2020-10-01T20:17:58Z")

</div>

OMG its working but I can see how this can take a while

---

<div class="post-metadata">

**Author:** ![santanera](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@santanera](https://community.mp3tag.de/u/santanera)\
**Post date:** [October 1, 2020, 8:18pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/4 "2020-10-01T20:18:48Z")

</div>

Is there no way to tell it that the first three parts are the name and then everything else is title? Maybe CMD command to rename all the files?

---

<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:** [October 2, 2020, 4:39am UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/5 "2020-10-02T04:39:04Z")

</div>

> [@santanera](#):
>
> Is there no way to tell it that the first three parts are the name and then everything else is title?

The problem is that there is no unique separator between the bits and pieces and this makes it much more difficult to tell MP3tag where the last hyphen starts.  
e.g  
`la-sonora-santanera-feliz-cumpleanos.mp3`  
If you define a pattern like  
`part1-part2-part3-rest`  
then it is not clear if "part3" is only "santanera" or, also possible, "santanera-feliz".  
And that is why you need 2 filters, and 2 renaming patterns. Once the filenames have the separation between the data for ARTIST and for TITLE there is just one go to import it with Conver\>Filename-Tag.

---

<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:28pm UTC](https://community.mp3tag.de/t/help-with-convert-filename-to-tag/50339/6 "2026-02-09T12:28:51Z")

</div>


