# Need Help With This Action

**URL:** https://community.mp3tag.de/t/need-help-with-this-action/15457
**Category:** Support
**Created:** [February 3, 2014, 5:02am UTC](https://community.mp3tag.de/t/need-help-with-this-action/15457 "2014-02-03T05:02:40Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 3, 2014, 7:46am UTC](https://community.mp3tag.de/t/need-help-with-this-action/15457/3 "2014-02-03T07:46:40Z")

</div>

> [@eleifer](#):
>
> So, here is an example album title:  
> "Record Label 001 (MM/DD/YY) Name of release"  
> How would I change it to:  
> "Record Label YYYY-MM-DD Name of release"  
> Please let me know what I need to do, I have ~300 albums I would like to batch edit if possible. Luckily, they are all released in the year 2000 or later so I dont have to worry about a 19-- date. Thankyou!

There is a formula for formatting the date from MDY to YMD ...  
[Turn D/M/YYYY into YYYY/MM/DD](https://community.mp3tag.de/t/9074/9)  
But knowing this alone will not help at all.

Mp3tag provides several ways to solve the given task.  
Following there is outlined one way to go.

To get your goal you have to do some modifications to the title string.  
The title string has to be splitted into components and then re-assembled into new formatted string.

**TITLE is given: Record Label 001 (02/01/09) Name of release TITLE should be: Record Label 2009-02-01 Name of release Step 1 Modify the given string, so that it can be easily splitted into components by Mp3tag action** 

**"Guess values (import tag-fields)"**

 **Replace all space characters with underline characters. Replace underline characters in conjunction with round brackets with sp**

**ace characters.**

 **TITLE \<== $replace(%TITLE%,' ','\_','\_(',' (',')\_',') ') Result should be ... Record\_Label\_001 (02/01/09) Name\_of\_release Step 2 Run action "Guess values" using guessing pattern ... %TMP\_RL% (%TMP\_MDY%) %TMP\_NOR% Result should be three new tag-fields (see dialog "Extended Tags...") TMP\_RL = Record\_Label\_001 TMP\_MDY = 02/01/09 TMP\_NOR = Name\_of\_release Step 3 Remove the trailing number from the Record Label ... TMP\_RL \<== $cutRight(%TMP\_RL%,4) Step 4 Modify date format MDY to YMD using the formula ... TMP\_YMD \<== $regexp($regexp(%TMP\_MDY%,'(\d\d?)/(\d\d?)/((?:\d\d)?(?:\d?\d))','0000$3-00$1-00$2'),'0\*(\d\d\d\d)-0\*(\d\d)-0\*(\d\d)','$1-$2-$3') Step 5 Set century for the YMD date ... TMP\_YMD \<== '20'$cutLeft(%TMP\_YMD%,2) Step 6 Assemble the new title string ... TITLE \<== %TMP\_RL% %TMP\_YMD% %TMP\_NOR% Step 7 Change the underline characters to space characters ... TITLE \<== $replace(%TITLE%,'\_',' ') Step 8 Remove all helper tag-fields ... TMP\_RL;TMP\_NOR;TMP\_MDY;TMP\_YMD**

You can put all steps into one action group ...

Begin Action Group **Test\_2014#20140203.eleifer.RecordLabel.MDYtoYMD** 

Action #1  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **$replace(%TITLE%,' ','_','_(',' (',')\_',') ')**  
_Guessing pattern:_ **%TMP\_RL% (%TMP\_MDY%) %TMP\_NOR%**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_RL**  
_Formatstring:_ **$cutRight(%TMP\_RL%,4)**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_YMD**  
_Formatstring:_ **$regexp($regexp(%TMP\_MDY%,'(\d\d?)/(\d\d?)/((?:\d\d)?(?:\d?\d))','0000$3-00$1-00$2'),'0\*(\d\d\d\d)-0\*(\d\d)-0\*(\d\d)','$1-$2-$3')**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_YMD**  
_Formatstring:_ **'20'$cutLeft(%TMP\_YMD%,2)**

 

Action #5  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_:_ _ **TITLE**  
 Formatstring: **$replace(%TMP\_RL% %TMP\_YMD% %TMP\_NOR%,'**_**',' ')**

 

Action #6  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_RL;TMP\_NOR;TMP\_MDY;TMP\_YMD**

 

End Action Group **Test\_2014#20140203.eleifer.RecordLabel.MDYtoYMD** (6 Actions)

 

DD.20140203.0958.CET

 

There is also a rather short way ...

  

**Convert** | **Tag - Tag** | **ALT+5**  
Field:  
**TITLE**  
Format string:  
**$regexp(%TITLE%,'^(.+?)\s\d\d\d\s((\d\d)/(\d\d)/(\d\d))\s(.+?)$','$1 20$4-$2-$3 $5')**  
Preview  
From: **Record Label 001 (02/01/09) Name of release**  
To : **Record Label 2009-02-01 Name of release**

  

DD.20140203.1245.CET

---

_[View the full topic](https://community.mp3tag.de/t/need-help-with-this-action/15457)._
