# How to extract text from a field & embed it in another field

**URL:** https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420
**Category:** General Discussion
**Created:** [September 9, 2007, 2:48pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420 "2007-09-09T14:48:16Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 9, 2007, 2:48pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/1 "2007-09-09T14:48:16Z")

</div>

All my ALBUM tags have the year between brackets: e.g. "Superstar (1999)".  
How can I make an action that only extracts "1999" and puts it into the YEAR tag?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 9, 2007, 3:54pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/2 "2007-09-09T15:54:06Z")

</div>

_Action type:_ **Format value**  
_Field:_ **YEAR**  
_Formatstring:_ **$regexp(%album%,'^.+?((\d{4}))'.\*?$,$1)**

---

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 9, 2007, 5:45pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/3 "2007-09-09T17:45:06Z")

</div>

Thank you! Will take some time for me to learn these format strings.  
In order not to have redundant data, I'd now like to delete everything between brackets (and the brackets itself) in the ALBUM tag. E.g.: "Superstar (1999, CD1)" \>\> "Superstar"  
Any help for this?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 9, 2007, 8:09pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/4 "2007-09-09T20:09:50Z")

</div>

One possibility:  
_Action type:_ **Guess values**  
_Source format:_ **%album%**  
_Guessing pattern:_ **%album% (%dummy%)**

---

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 10, 2007, 3:23pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/5 "2007-09-10T15:23:46Z")

</div>

I can't find the action "guess values" as I'm using the German version. Do you know what it's called there?

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [September 10, 2007, 3:38pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/6 "2007-09-10T15:38:29Z")

</div>

It's called Tag-Felder importieren.

---

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 10, 2007, 4:00pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/7 "2007-09-10T16:00:27Z")

</div>

> [@dano](#):
>
> _Action type:_ **Format value**  
> _Field:_ **YEAR**  
> _Formatstring:_ **$regexp(%album%,'^.+?((\d{4}))'.\*?$,$1)**

This works fine, if I ONLY have the year between brackets in the album tag. However, often I have a structure like e.g Superstar (1999, ALBW, CD1) or e.g. Superstar (1999, Unknown Album). The year is always after the bracket "(" and before the comma ",".  
If I use the above action, the whole album tag is copied to the year tag. I'd like to extract only the year.  
Sorry, hope this is my last question.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 10, 2007, 4:07pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/8 "2007-09-10T16:07:49Z")

</div>

Change to $regexp(%album%,'^.+?((\d{4}).\*?$',$1)

---

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 13, 2007, 4:51pm UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/9 "2007-09-13T16:51:59Z")

</div>

Just noticed one more thing I want to change in the artist field. E.g.: Cure (The) \>\> The Cure. Which action?

---

<div class="post-metadata">

### Author: ![luegoo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@luegoo](https://community.mp3tag.de/u/luegoo)
#### Post date: [September 21, 2007, 7:09am UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/10 "2007-09-21T07:09:22Z")

</div>

Really nobody knows this?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 21, 2007, 8:27am UTC](https://community.mp3tag.de/t/how-to-extract-text-from-a-field-embed-it-in-another-field/5420/11 "2007-09-21T08:27:44Z")

</div>

Same action type as last one  
$regexp(%artist%,^(.+?)\s+((The))$,$2 $1)
