# Year tag reformatting with \\\\ in tag

**URL:** https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537
**Category:** Support
**Created:** [March 1, 2022, 6:28pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537 "2022-03-01T18:28:23Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 6:28pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/1 "2022-03-01T18:28:23Z")

</div>

Hello,

I am new using mp3tag. I have been trying to change the value stored in the YEAR tag.

So I have the following values stored in the year tag(s) for example:  
1906\\2020

therefore following the pattern:  
DDMM\\YYYY

I am trying to reformat it to the following pattern:  
YYYY\\YYYY-MM-DD

Reading a number of posts on this forum, I have tried to use the following:  
Action \> Format Values for the YEAR field with the following expression:  
$regexp(%year%,(\d\d)(\d\d)'\\(\d\d\d\d),$1'\\$3-$2-$1)

where I use ' character to escape the \\ so I can still print this as is, except it doesn't give what I am expecting.

As a result from my example, it renders the year field with the value of:  
1906  
and not  
2020\\2020-06-19

How do I write it to achieve the result I am trying to get please?

thanks

---

<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: [March 1, 2022, 6:33pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/2 "2022-03-01T18:33:18Z")

</div>

On the trouble with the double backslash see e.g. here:

> [@Reformating YEAR field](https://community.mp3tag.de/t/reformating-year-field/17926/2):
>
> The \\ is MP3tag's representation of a multi-value field: you have at least 2 fields of the type YEAR in the files. There are action to either merge the fields to one field (use a different separator than \\) or to delete all duplicate fields. Or you have a look at the extended tags dialogue (Alt-T) and see the fields there and decide which field to delete.

The long date with year, month and day should be stored in RELEASETIME as YEAR has only 4 digits according to the ID3 standard.

---

<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: [March 1, 2022, 6:40pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/3 "2022-03-01T18:40:13Z")

</div>

> [@temboroho](#):
>
> So I have the following values stored in the year tag(s) for example:  
> 1906\2020

Can you please show us a [screen shot](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-screenshots-to-exemplify-the-issue-2) after pressing ALT + T on one of your tracks?  
I can't imagine how you would have `1906\\2020` stored as one value in your year tag.

If you mean you have one YEAR tag with 1906 and another with 2020 it would be very hard to detect the difference between the year "Nineteen-oh-six" and the "19 June" and the year "Twenty-Twenty".

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 6:49pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/5 "2022-03-01T18:49:25Z")

</div>

Thank you for your response.

I get the logic you follow ie separating the values in 2 distinct fields rather double the same one twice but I don't know how to achieve this.

---

<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: [March 1, 2022, 6:50pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/6 "2022-03-01T18:50:21Z")

</div>

There is no `\\` in your example, just a `-` between 1003 and 2021.  
_(At least this was shown in your first screen shot...)_

---

<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: [March 1, 2022, 6:51pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/7 "2022-03-01T18:51:18Z")

</div>

No, actually, you have to merge the 2 YEAR fields first,  
then arrange them with the regular expression,  
then copy the data to RELEASETIME  
and then cut YEAR to just 4 digits

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 6:53pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/8 "2022-03-01T18:53:14Z")

</div>

sorry about this I had played around in the direction of merging the fields and uploaded the wrong screenshot.

I updated the initial post with the proper one.

---

<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: [March 1, 2022, 7:01pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/9 "2022-03-01T19:01:14Z")

</div>

I'm still not convinced that this will work with all your occurences in the year tags, but you can TEST it with this format string:

`$regexp($meta_sep(year,\\),'(\d\d)(\d\d)\\\\(\d{4})',$3\\\\$3-$2-$1)`

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

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 7:08pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/11 "2022-03-01T19:08:17Z")

</div>

> [@LyricsLover](#):
>
> `$regexp($meta_sep(year,\\),'(\d\d)(\d\d)\\\\(\d{4})',$3\\\\$3-$2-$1)`

oh nice, it did the work!! Thank you

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 7:13pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/12 "2022-03-01T19:13:04Z")

</div>

I tried it on a batch of files with similar conditions and it worked for all of them. 🙂  
Thanks again

---

<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: [March 1, 2022, 7:15pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/13 "2022-03-01T19:15:48Z")

</div>

As long as you get MMDD from the first YEAR tag (which is AFAIK not garantueed) it should work.

And as @ohrenkino already told you:  
Your new YEAR tag format does not match the standard YYYY anymore!

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 7:20pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/14 "2022-03-01T19:20:55Z")

</div>

I understand it would be better to split the fields into Year and ReleaseTime but I don't know how to do this yet...  
If you guys want to share a step by step on how to I would be very happy to do it but I don't mean to abuse of your time/help...

---

<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: [March 1, 2022, 7:23pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/15 "2022-03-01T19:23:28Z")

</div>

You could try an action of the type "Guess value"  
Source: `$meta_sep(year,==)`  
Target pattern: `%year%==%releasetime%`

---

<div class="post-metadata">

### Author: ![temboroho](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f4b2a3/32.png) [@temboroho](https://community.mp3tag.de/u/temboroho)
#### Post date: [March 1, 2022, 7:35pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/16 "2022-03-01T19:35:24Z")

</div>

> [@ohrenkino](#):
>
> %year%==%releasetime%

oh this awesome! After I got the results from [LyricsLover](https://community.mp3tag.de/u/LyricsLover) script if I apply your action to the result it give me the right split of value and field between Year and ReleaseTime.

Great help guys, thank you so much! 🙂

---

<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: [March 31, 2022, 7:36pm UTC](https://community.mp3tag.de/t/year-tag-reformatting-with-in-tag/56537/17 "2022-03-31T19:36:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
