# Add part of the filename to the title tag

**URL:** <https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774>\
**Category:** Support\
**Created:** [June 29, 2019, 12:21am UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774 "2019-06-29T00:21:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BobGee](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@BobGee](https://community.mp3tag.de/u/BobGee)\
**Post date:** [June 29, 2019, 12:21am UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/1 "2019-06-29T00:21:52Z")

</div>

Can someone help me please?  
I have a bunch of Whitburn pop files in the format:  
Year\_number - artist - title  
1951\_001 - Johnny Ray & Four Lads - Cry 80 M (3.02).mp3  
The current title tag is Cry.  
I would like to change that to 1951\_001 Cry  
I tried Convert but it adds the info after Cry in the filename.  
I also tried some actions, but couldn't figure out how to extraxt the year number part of the filename.

---

<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:** [June 29, 2019, 8:01am UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/2 "2019-06-29T08:01:41Z")

</div>

Try an action of the type "Guess value"  
Source: `$regexp(%_filename%,(.*?) -.*,$1) %title%`  
Target: %title%

---

<div class="post-metadata">

**Author:** ![BobGee](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@BobGee](https://community.mp3tag.de/u/BobGee)\
**Post date:** [June 29, 2019, 6:02pm UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/3 "2019-06-29T18:02:04Z")

</div>

If I create an action of type "Guess Value", I get prompted for source format and Guessing pattern. It does not prompt me for target. Thanks for the response, but I need more help. If I use an action of type "Replace Value" I think it would do what I want, but I can't figure out the correct syntax for the field, "Replace with".

---

<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:** [June 29, 2019, 9:48pm UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/4 "2019-06-29T21:48:28Z")

</div>

> [@BobGee](#):
>
> Guessing pattern. It does not prompt me for target

ok, there are 2 strings that you have to enter. One is the "Source format"(?) and the other one a format string as target. I have the German version so apparently the translation does not quite match.  
An action of the type "Replace" will not really work.

---

<div class="post-metadata">

**Author:** ![BobGee](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@BobGee](https://community.mp3tag.de/u/BobGee)\
**Post date:** [June 29, 2019, 10:02pm UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/5 "2019-06-29T22:02:48Z")

</div>

I figured out a 2-step conversion that works.

1, Convert filename to tag with format string %year% - %dummy%  
That puts the Year\_number from the filename into the year field. It overwrites whatever was in the year field, but I can live with that.

1. convert tag - tag with TITLE in the field and %year% %title% in the format string.  
Thanks for looking at my problem and making suggestions.

---

<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:** [June 29, 2019, 10:20pm UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/6 "2019-06-29T22:20:17Z")

</div>

If you use a user-defined field like %myyear% instead of %year% in

> [@BobGee](#):
>
> Convert filename to tag with format string %year% - %dummy%

the you do not loose the original content of YEAR.

The second step would have instead of

> [@BobGee](#):
>
> %year% %title%

%myyear% %title%

Afterwards you may delete MYYEAR.  
But all this could be accomplished in just one step with the "Guess value" example.

---

<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:** [June 30, 2019, 4:10am UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/7 "2019-06-30T04:10:57Z")

</div>

> [@ohrenkino](#):
>
> format string as target. I have the German version so apparently the translation does not quite match.

It's called "Guessing Pattern".

---

<div class="post-metadata">

**Author:** ![BobGee](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@BobGee](https://community.mp3tag.de/u/BobGee)\
**Post date:** [June 30, 2019, 4:30pm UTC](https://community.mp3tag.de/t/add-part-of-the-filename-to-the-title-tag/45774/8 "2019-06-30T16:30:57Z")

</div>

I am happy with my solution. It works on all my many files. Thanks for all the responses, guys.

---

<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/add-part-of-the-filename-to-the-title-tag/45774/9 "2026-02-09T12:28:08Z")

</div>


