# How to remove leading parts of a YEAR tag, but not with all of them?

**URL:** <https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595>\
**Category:** Support\
**Created:** [October 1, 2021, 6:52pm UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595 "2021-10-01T18:52:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pretzel](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pretzel/32/9961_2.png) [@pretzel](https://community.mp3tag.de/u/pretzel)\
**Post date:** [October 1, 2021, 6:52pm UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/1 "2021-10-01T18:52:25Z")

</div>

It's hard for me to describe, so I'll just show you what I mean.

![image](https://community.mp3tag.de/uploads/default/original/2X/9/988cafbcef0c0a7a3287d76da7b74d80db44d18d.png)

Some of my albums have the month and day included and some don't. I want to make it so all of the dates are just the year, like at the bottom of my picture.

I'm familiar with the $cutright function. I've been using:

```auto
$cutright(%year%, 6)

```

to remove the extra bits, but I've done that by manually selecting tracks that have the extra characters in it. **I'm wondering what tag-to-tag format string could be constructed so I could just select all my tracks, and have it remove the 6 characters from the right on tracks with the extended dates and not remove any characters on tracks with just the year.**

I'm not very knowledgeable when it comes to planning out scripts like this, but it seems like this could be done with some boolean function that checks if the YEAR field has more than 4 characters, and if it does, it runs the $cutright function. I also see that $len exists, so that could be used to check how many characters the field has.

I feel like I have all the pieces, I'm just not familiar with with formatting stuff like this. What string would you write for the problem I'm having?

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 1, 2021, 7:19pm UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/2 "2021-10-01T19:19:01Z")

</div>

What about keeping the left 4 numbers (the year) and cut away the part on the right side.  
Something like  
`$left(%year%,4)`

![image](https://community.mp3tag.de/uploads/default/original/2X/d/d984eb569b9becbe1a54722146d526e3384d3992.png)

---

<div class="post-metadata">

**Author:** ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)\
**Post date:** [October 1, 2021, 7:19pm UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/3 "2021-10-01T19:19:32Z")

</div>

You could just use `$left(%year%,4)` to get the first four characters.

---

<div class="post-metadata">

**Author:** ![pretzel](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pretzel/32/9961_2.png) [@pretzel](https://community.mp3tag.de/u/pretzel)\
**Post date:** [October 1, 2021, 7:30pm UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/4 "2021-10-01T19:30:31Z")

</div>

🤦‍♂️

There's always a simpler solution I didn't think of. Thank you both!!

---

<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, 2021, 6:17am UTC](https://community.mp3tag.de/t/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/5 "2021-10-02T06:17:49Z")

</div>

Just to add one more:  
$num(%year%,1)  
would also cut away anything that is no number, here: everything starting with the first hypen

---

<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/how-to-remove-leading-parts-of-a-year-tag-but-not-with-all-of-them/54595/6 "2026-02-09T12:29:27Z")

</div>


