# How to convert filename to tags

**URL:** <https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592>\
**Category:** Support\
**Created:** [April 1, 2023, 6:17pm UTC](https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592 "2023-04-01T18:17:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danitran](https://community.mp3tag.de/user_avatar/community.mp3tag.de/danitran/32/13668_2.png) [@danitran](https://community.mp3tag.de/u/danitran)\
**Post date:** [April 1, 2023, 6:17pm UTC](https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592/1 "2023-04-01T18:17:56Z")

</div>

Hi everyone, I'm new to mp3tag. I want to split file name like this:  
**File name:** `How to Train your Dragon 2 Soundtrack 10 Flying with Mother John Powell.mp3`

into these tags:  
Album: How to Train your Dragon 2 Soundtrack  
Title: Flying with Mother  
Artist: John Powell

I'm using the format:  
%album% %dummy% %title% %artist%  
but it show up like this

Album: How to Train your Dragon 2 Soundtrack  
Title: Flying  
Artist: with Mother John Powell

Can anyone help me with this? because the album and the title have double space between them but there's only one space between title and artist so I don't know how to split those.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![danitran](https://community.mp3tag.de/user_avatar/community.mp3tag.de/danitran/32/13668_2.png) [@danitran](https://community.mp3tag.de/u/danitran)\
**Post date:** [April 1, 2023, 6:20pm UTC](https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592/2 "2023-04-01T18:20:41Z")

</div>

I just found out that I can do it like this: %album% %dummy% %title% %title% %title% %artist%  
But is there another way to specify how many words in the string for each tag? Like it would be great if I can tell it to take the last 2 words for artist name.

---

<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:** [April 1, 2023, 6:25pm UTC](https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592/3 "2023-04-01T18:25:45Z")

</div>

I would not try to get all the data into the correct tags in 1 go.  
Try to import first the parts that you can assign without problems.  
In this case I would import

> [@danitran](#):
>
> Flying with Mother John Powell

into TITLE.  
and then split TITLE with something like an action of the type "Guess values"  
Source string: `$regexp(%title%,(.*) (.*? .*?),$1==$2)`  
Target string: `%title%==%artist%`

Alternatively, you use the action of the type "Guess value" straight away:  
Source pattern: `$regexp(%_filename%,(.*) (.*?) (\d+) (.*) (.*? .*?),$1==$2==$3==$4==$5)`  
Target pattern: `%album%==%genre%==%track%==%title%==%artist%`

---

<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:30pm UTC](https://community.mp3tag.de/t/how-to-convert-filename-to-tags/60592/4 "2026-02-09T12:30:04Z")

</div>


