# Action to extract information from the title

**URL:** https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576
**Category:** Support
**Created:** [February 19, 2025, 1:25pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576 "2025-02-19T13:25:56Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [February 19, 2025, 1:25pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/1 "2025-02-19T13:25:56Z")

</div>

Hello, I have a lot of mp3s in which the title is structured as follows:

```auto
Hootology (Feat. BoriRock & Shaykh Hanif) (Remix) [Prod. By 4th Beats]

```

I would like to use an action to copy the following information from them:

%artists% : BoriRock & Shaykh Hanif  
%composer% : 4th Beats

I can do it with tag - tag but not with an action

tag - tag

```auto
ARTISTS
$regexp(%title%,'.*? \(Feat\. (.*?)\).*',$1)

```

```auto
COMPOSER
$regexp(%title%,'.*?\[Prod\. By (.*?)\]',$1)

```

Can you help me with how I can pack this into an action?

---

<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: [February 19, 2025, 1:28pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/2 "2025-02-19T13:28:36Z")

</div>

> [@Bomba](#):
>
> I can do it with tag - tag but not with an action

The action equivalent to Convert\>Tag-Tag is an action of the type "Format value"

BTW: this information was made available to you already in this thread:

> [@Replace (Prod by XXX) to \[Prod. by XXX\]](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/6):
>
> Scripting functions can be used in format strings. So an action of the type "Format value" would be good. Or the Converter\>Tag-Tag. You have not yet mentioned which field you want to modify.

---

<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: [February 19, 2025, 1:29pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/3 "2025-02-19T13:29:55Z")

</div>

Action from type "[Format Value](https://docs.mp3tag.de/actions/format/)" that looks like this:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/7/f/7f1d1d0f3d7269e1554214809520db9cfc32522c.png)  
the same for COMPOSER with your second regular expression as Format string.

Results in

 ![image](https://community.mp3tag.de/uploads/default/original/3X/5/5/554a723a4d52f8a4b49a18ac3408801be26f055c.png)

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [February 19, 2025, 1:58pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/4 "2025-02-19T13:58:36Z")

</div>

I just noticed another problem.

If the title doesn't have (Feat. xyz) and/or [Prod. By xyz], the whole title is copied. Can this be prevented?

---

<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: [February 19, 2025, 2:02pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/5 "2025-02-19T14:02:00Z")

</div>

> [@Bomba](#):
>
> Can this be prevented?

Only if you adjust your regular expression.  
A regular expression does not work for every variation.  
You can either use several different regular expressions (and Actions) or you can try to fine-tune your existing one. Even this will not work for every thinkable form of TITLE content.

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [February 19, 2025, 2:03pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/6 "2025-02-19T14:03:14Z")

</div>

Do you have any idea how to check whether the title includes Feat. and/or Prod.?

---

<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: [February 19, 2025, 2:05pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/7 "2025-02-19T14:05:36Z")

</div>

Sorry, you have to build your examples and try it by your self, for example with the help of online tools like [regex101.com](https://regex101.com/r/GcmcyN/1).  
I would have to do the same.

---

<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: [February 19, 2025, 2:09pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/8 "2025-02-19T14:09:03Z")

</div>

> [@Bomba](#):
>
> check whether the title includes Feat. and/or Prod.?

The easiest way would be to apply filters and then treat only matching files.

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [February 19, 2025, 2:24pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/9 "2025-02-19T14:24:38Z")

</div>

that works

```auto
$if($eql($regexp(%title%,'.*? \(Feat\. (.*?)\).*','$1'),%title%),, $regexp(%title%,'.*? \(Feat\. (.*?)\).*','$1'))  

```

---

<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: [February 19, 2025, 2:34pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/10 "2025-02-19T14:34:53Z")

</div>

Please test your functions and regular expressions carefully.  
Your above THEN part would at least add a space in front of the extracted part, because of  
`,, $regexp`  
` ↑ `  
Every character counts. 😉

---

<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 21, 2025, 2:35pm UTC](https://community.mp3tag.de/t/action-to-extract-information-from-the-title/67576/11 "2025-03-21T14:35:30Z")

</div>

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