# Few actions I can't figure out

**URL:** https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927
**Category:** Support
**Created:** [June 9, 2008, 3:28am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927 "2008-06-09T03:28:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![djodjolyon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@djodjolyon](https://community.mp3tag.de/u/djodjolyon)
#### Post date: [June 9, 2008, 3:28am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/1 "2008-06-09T03:28:44Z")

</div>

Hello,

I'm looking for actions I tried to find, unsuccessfully.

**1. Manage fields**  
I want to put lots of information about a cd.  
So, here is how I tried to do it :

1/ I put the informations in a text file. It looks like that:

 Label : Makasound -

```
Producteur : Michael Ashley & Bob Marley -
Artist :
Vocals : Mikey Ras Starr -<!--colorc--></span><!--/colorc-->

```

 

2/ I import the text file in mp3tag in unsencedlyrics. So it looks like that:

 eng||Label : Makasound -[square][square]Producteur : Michael Ashley & Bob Marley -[square][square]Artist :[square][square]Vocals : Mikey Ras Starr - 

3/ I made the different fields, producteur, Artist etc.

 

```
So now, the goal is to put the right information in the right field.
I could make it for Label :
regular expression : <!--coloro:#3333FF--><span style="color:#3333FF"><!--/coloro-->(^|(.+))(Producteur\s:\s)(\w*)( -+(.+))<!--colorc--></span><!--/colorc-->
replace with : <!--coloro:#3333FF--><span style="color:#3333FF"><!--/coloro-->$4<!--colorc--></span><!--/colorc-->

The issue is that it doesn't work with the others because of the [square]
Have you any idea? I really hope there is a solution for that... 

```

 

**2. Rename directories**  
I have two problems with that.

 

My folder are like this :  
Genre Folder \> Artist Folder \> Album Folder

 

I want to rename automaticaly the folders, not to create it (they already exists).  
I'd like to rename the artist folder with the artist name, but I can't figure out how to do that...  
And for the album folder, I would like it to be [year] Album  
But I didn't find the way to put "[" and "]".

 

**3. Advanced case feature**  
I want all the title in lower caps but I want to keep uppercase if there is 2 or more.  
exemple :  
I have : DLO **S** omethING **G** oes TO ffEE **T** hYE  
I want : DLO **s** omethING **g** oes TO ffEE **t** hYE

 

**4. Just informations**  
Where is the part that explain how to use if function?

 

Thanks in advance

---

<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: [June 9, 2008, 2:30pm UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/2 "2008-06-09T14:30:19Z")

</div>

> [@djodjolyon](#):
>
> ...1/ I put the informations in a text file. It looks like that:
> 
> Label : Makasound -
> 
> ```
> Producteur : Michael Ashley & Bob Marley -
> Artist :
> Vocals : Mikey Ras Starr -<!--colorc--></span><!--/colorc--> ...
> 
> ```

I understand that you use the unsyncedlyrics field as a temporary storage to hold a list of values which you want to distribute into separated tag fields.

The list is a multiline string containing some carriage return sequences, which are displayed in grid view as square boxes, in Extended Tag View as line breaks.

In a first step you should get rid of those carriage return sequences. Replace them with some other human readable special character by using $replace() or regexp(), e. g.

- **$replace(%UNSYNCEDLYRICS%,$char(13)$char(10),$char(124))**
- **$regexp(%UNSYNCEDLYRICS%,\r\n,|)**

Afterwards use some fitting regular expression to fetch the data value from the string, e. g. for tag field producteur extract the text sequence from the list between " **|Producteur :**" and next following " **-|**" and you will get " **Michael Ashley & Bob Marley**", e. g.  
**$regexp(%UNSYNCEDLYRICS%,._|Producteur : (.+?) -|._,$1)**

DD.20080609.1830.CEST

---

<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: [June 9, 2008, 5:57pm UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/3 "2008-06-09T17:57:24Z")

</div>

> [@djodjolyon](#):
>
> ... I want all the title in lower caps but I want to keep uppercase if there is 2 or more.  
> exemple :  
> I have : DLO **S** omethING **G** oes TO ffEE **T** hYE  
> I want : DLO **s** omethING **g** oes TO ffEE **t** hYE ...

Maybe this matches your need:  
$regexp(%title%,\b(.\U),\l$1)

DD.20080609.2157.CEST

---

<div class="post-metadata">

### Author: ![djodjolyon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@djodjolyon](https://community.mp3tag.de/u/djodjolyon)
#### Post date: [June 10, 2008, 2:09am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/4 "2008-06-10T02:09:58Z")

</div>

Thanks for your help

> [@DetlevD](#):
>
> In a first step you should get rid of those carriage return sequences. Replace them with some other human readable special character by using $replace() or regexp(), e. g.
> 
> - $replace(%UNSYNCEDLYRICS%,$char(13)$char(10),$char(124))
> - $regexp(%UNSYNCEDLYRICS%,\r\n,|)

That works great. Cool...

But I tought it was going to be easy to do the regexp to move the information in it's field... It's not!  
I tried for more than 2 hours. But I really can't find it.  
Here is an image of my action to do the whole thing. You'll see better what I did.

The regexp only works for producer field but not for the others...  
I don't know why...  
Can you help me doing that please...

> [@](#):
>
> Maybe this matches your need:  
> $regexp(%title%,\b(.\U),\l$1)

That works vey well.  
Thanks a lot.

---

<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: [June 10, 2008, 3:32am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/5 "2008-06-10T03:32:19Z")

</div>

> [@djodjolyon](#):
>
> ... But I tought it was going to be easy to do the regexp to move the information in it's field... It's not!  
> I tried for more than 2 hours. But I really can't find it. ...

At first of all you have to make sure, that your input data is properly organized.

Each data line must follow the same data sequence mask.  
In your case you have build one data line out of:

FieldName

Blank  
Colon  
Blank  
FieldValue  
Blank  
Hyphen  
CarriageReturn  
Linefeed

 

See "Artist" line in your input file. There is an inconsistency in the data structure.

 

Your input text file should look like:

 

```
Label : Makasound -
Producteur : Michael Ashley & Bob Marley -
Artist : -
Vocals : Mikey Ras Starr -

```

 

Run an actionsgroup:

 
- Load the file data into a temporary tag field.
- Make the data human readable (not so important).
- Make the data safe for processing.
- Format tag field values from data.
- Delete temporary tag field.

 

e. g.  
Begin Actionsgroup **TEST\_DJO**

 

Action #1  
_Actiontype 14:_ **Import text file**  
_Field:_ **DJO\_LIST**  
_Filename:_ **O:\TEST\DJO.TXT**

 

Action #2  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_LIST**  
_Formatstring:_ **|$regexp(%DJO\_LIST%,\r\n,|)|**

 

Action #3  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_ARTIST**  
_Formatstring:_ **%DJO\_LIST%**

 

Action #4  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_LABEL**  
_Formatstring:_ **%DJO\_LIST%**

 

Action #5  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_PRODUCER**  
_Formatstring:_ **%DJO\_LIST%**

 

Action #6  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_VOCALS**  
_Formatstring:_ **%DJO\_LIST%**

 

Action #7  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_ARTIST**  
_Formatstring:_ **$regexp(%DJO\_ARTIST%,._|Artist÷:÷(._?)÷-|.\*,$1)**

 

Action #8  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_LABEL**  
_Formatstring:_ **$regexp(%DJO\_LABEL%,._|Label÷:÷(._?)÷-|.\*,$1)**

 

Action #9  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_PRODUCER**  
_Formatstring:_ **$regexp(%DJO\_PRODUCER%,._|Producteur÷:÷(._?)÷-|.\*,$1)**

 

Action #10  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DJO\_VOCALS**  
_Formatstring:_ **$regexp(%DJO\_VOCALS%,._|Vocals÷:÷(._?)÷-|.\*,$1)**

 

Action #11  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **DJO\_LIST**

 

Note: Replace one special character ÷ with one space character.  
End Actionsgroup **TEST\_DJO** (11 Actions)

 

The above procedure creates three tag fields:

 DJO\_LABEL ...: Makasound

DJO\_PRODUCER : Michael Ashley & Bob Marley  
DJO\_VOCALS ..: Mikey Ras Starr

 

Be aware about the fact, that an empty field value does not create a tag field.  
DJO\_ARTIST has not been created.

 

DD.20080610.0732.CEST

---

<div class="post-metadata">

### Author: ![djodjolyon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@djodjolyon](https://community.mp3tag.de/u/djodjolyon)
#### Post date: [June 10, 2008, 4:04pm UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/6 "2008-06-10T16:04:52Z")

</div>

Hi,

I nearly finished what I wanted... It works well but I need one thing to simplify it.

I have that:  
Format value  
Field : MUSICIENS  
Format : $regexp(%MUSICIENS%,^|{2}(.\*?),$1)

I would like to apply this regex to many fields but not all.  
Is it possible with the regex or I have to do the same action many times?

And one other thing...  
I need an action to switch word sequencies in the field Musicians.

Here is how the field look like :

||Musiciens :| \> (Vocals) : Mikey Ras Starr| \> (Drum) : Mickey mouse| \> (Chorus) Le dromadaire

And I want to have something like that :

||Musiciens :| \> Mikey Ras Starr (Vocals)| \> Mickey mouse (Drum)| \> Le dromadaire (Chorus)

I just want to switch the instrument and the artiste name.

The expression I made work perfectly if there is only one artist, but when I apply it to many artists, it just become mad!!  
It gives something like that :

||Musiciens :| \> Mickey mouse (Vocals) : Mikey Ras Starr| \> (Drum)| \> (chorus) Le dromadaire

Here is one of the many expression I made (but didn't work ☹ ):  
regex : ((.+))\s\*:\s\*(.+)|  
replace : $2 $1|

When I have finished, I'will put everything I've done!  
Big thanks DetlevD 😉

---

<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: [June 11, 2008, 5:22am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/7 "2008-06-11T05:22:49Z")

</div>

> [@djodjolyon](#):
>
> ... Format : $regexp(%MUSICIENS%,^|{2}(.\*?),$1)  
> I would like to apply this regex to many fields but not all.  
> Is it possible with the regex or I have to do the same action many times? ...

Think about organizing your data to simplify your work before coming into such situation.  
I think you have to do one action for each tag field.  
Discover meta tag field \_TAG and try out if it can support to realize what you want.

> [@djodjolyon](#):
>
> ...  
> I need an action to switch word sequencies in the field Musicians. ...  
> I just want to switch the instrument and the artiste name. ...

Look at your data (inconsistent structure):

```
||Musiciens :| > (Vocals) : Mikey Ras Starr| > (Drum) : Mickey mouse| > (Chorus) Le dromadaire

```

Look at this data (consistent structure) (added: space, colon, pipe):

```
||Musiciens :| > (Vocals) : Mikey Ras Starr| > (Drum) : Mickey mouse| > (Chorus) : Le dromadaire|

```

Use $regexp(%yourtagfield%,((.+?)) : (.+?)|,$2 $1|)

Result:

```
||Musiciens :| > Mikey Ras Starr (Vocals)| > Mickey mouse (Drum)| > Le dromadaire (Chorus)|

```

DD.20080611.0922.CEST

---

<div class="post-metadata">

### Author: ![djodjolyon](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/cab0a1/32.png) [@djodjolyon](https://community.mp3tag.de/u/djodjolyon)
#### Post date: [June 11, 2008, 11:08am UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/8 "2008-06-11T11:08:02Z")

</div>

> [@](#):
>
> Think about organizing your data to simplify your work before coming into such situation.  
> I think you have to do one action for each tag field.  
> Discover meta tag field \_TAG and try out if it can support to realize what you want.

Yes of course I have to organize it. That's what I wanted to do...  
I think Mp3tag do it wel!!

> [@](#):
>
> Look at your data (inconsistent structure):

This was normal! As I'm going to take the informations on the internet... I can have different structure.  
Here it was just for the try.

> [@](#):
>
> Use $regexp(%yourtagfield%,((.+?)) : (.+?)|,$2 $1|)

I'll become crazy!!!! I tried many many times as usual. And it wasn't working just because one f\*\*\*\*\*\* character missing. ![:angry:](https://community.mp3tag.de/uploads/default/original/1X/ebadaff04ae073d3d1cb3e2f4c6acf132380e5a5.gif ":angry:")  
Well thanks. I know for next time!

I finish the whole thing and I put all the stuff I did

---

<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:21pm UTC](https://community.mp3tag.de/t/few-actions-i-cant-figure-out/6927/9 "2026-02-09T12:21:00Z")

</div>


