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


#1

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?


#2

Action type: Format value
Field: YEAR
Formatstring: $regexp(%album%,'^.+?((\d{4}))'.*?$,$1)


#3

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?


#4

One possibility:
Action type: Guess values
Source format: %album%
Guessing pattern: %album% (%dummy%)


#5

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


#6

It's called Tag-Felder importieren.


#7

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.


#8

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


#9

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


#10

Really nobody knows this?


#11

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