# Extract year from title

**URL:** <https://community.mp3tag.de/t/extract-year-from-title/43348>\
**Category:** Support\
**Created:** [October 22, 2018, 2:30am UTC](https://community.mp3tag.de/t/extract-year-from-title/43348 "2018-10-22T02:30:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJCyber](https://community.mp3tag.de/user_avatar/community.mp3tag.de/djcyber/32/5789_2.png) [@DJCyber](https://community.mp3tag.de/u/DJCyber)\
**Post date:** [October 22, 2018, 2:30am UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/1 "2018-10-22T02:30:29Z")

</div>

Ok here is an example for a filename I need altered.

1. Public Enemy - Shut Em Down (Pete Rock Remix) (1991).mp3

My question is...is there a script I can use to remove the leading numbers and the space (013. ) AND extract & remove the (1991) and place just the 1991 into the year tag?

I would do this manually but I have hundreds of files like this.

Thank in advance for your help. BTW I'm using version 2.89a

---

<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 22, 2018, 5:04am UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/2 "2018-10-22T05:04:06Z")

</div>

I hope that you have filled the title field.  
Because then you easily rewrite the filename with  
Convert\>Tag-Filename  
Format string: %title%

If the title field is still empty and you also want to fill the YEAR field, try  
Convert\>Filename-Tag  
Format string: %dummy%. %title% (%year%)

The same function can be used, to only get the year:  
Format string: %dummy% (%year%)

---

<div class="post-metadata">

**Author:** ![DJCyber](https://community.mp3tag.de/user_avatar/community.mp3tag.de/djcyber/32/5789_2.png) [@DJCyber](https://community.mp3tag.de/u/DJCyber)\
**Post date:** [October 22, 2018, 7:54pm UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/3 "2018-10-22T19:54:48Z")

</div>

Thanks for the reply. I have all tags already situated including artist and title..the only thing missing is the year...(which is showing in the file name). What I want to do is move the year from the file name and put it in to the "year" tag without having to do this for almost 2800 songs manually.

---

<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 22, 2018, 8:02pm UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/4 "2018-10-22T20:02:27Z")

</div>

so it is the 3rd case:

> [@ohrenkino](#):
>
> Format string: %dummy% (%year%)

to get the year.  
And then use Convert\>Tag-Filename and rewrite the filename with  
Format string %artist% - %title%

---

<div class="post-metadata">

**Author:** ![DJCyber](https://community.mp3tag.de/user_avatar/community.mp3tag.de/djcyber/32/5789_2.png) [@DJCyber](https://community.mp3tag.de/u/DJCyber)\
**Post date:** [October 22, 2018, 9:57pm UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/5 "2018-10-22T21:57:53Z")

</div>

You rock! But this is not quite what I want. I'm so sorry...

Here is what I am trying to do...

 ![Untitled-2](https://community.mp3tag.de/uploads/default/original/2X/6/670e721075b326fba5fdd377e24431b9f984a5d3.jpeg)

If you notice the leading numbers in the filename are gone as well as the year (in brackets) is moved to the "year" tag. What I end up with is the file name being the artist - title with no leading numbers and the year in the proper tag.

Thank you for your patience!

---

<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 23, 2018, 4:58am UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/6 "2018-10-23T04:58:45Z")

</div>

> [@DJCyber](#):
>
> If you notice the leading numbers in the filename are gone as well as the year

Yes, I thought that is what you meant when you wrote

> [@DJCyber](#):
>
> is there a script I can use to remove the leading numbers and the space (013. ) AND extract & remove the (1991) and place just the 1991 into the year tag

if you want to get the leading number back, try:  
Format string $num(%track%,2). %artist% - %title%

---

<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:27pm UTC](https://community.mp3tag.de/t/extract-year-from-title/43348/7 "2026-02-09T12:27:44Z")

</div>


