# Populating a field with info from another field

**URL:** https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822
**Category:** Support
**Created:** [June 12, 2025, 3:52am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822 "2025-06-12T03:52:19Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 3:52am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/1 "2025-06-12T03:52:19Z")

</div>

500 of my mp3 files have a comment as below:

"Debuted 11/03/1958 and peaked at #38 on the Hot 100 Chart. Source: Pop Annual. Label/Number: Ace 551. Date Peaked: 12/01/1958."

Info required:

**TAG** ----- **INFO**

DEBUT: ........ 11/03/1958  
PEAK: ........... #34  
CHART: ........ Hot 100 Chart  
PEAKED: ...... 12/01/1958

I've created tags DEBUT, PEAK, PEAKED, CHART.

Then tried using some derivation of various solutions offered for similar questions, but don't even get close. Probably due to my slight dementia, scripting doesn't make sense to me. (If that's not the term, I apologize in advance.)

This is one of the things I've tried:

Using FORMAT VALUE  
FIELD is DEBUT  
STRING is debut=$regexp(%comment%,'^.\*[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9]0-9].\*$

which makes sense to me, but there's no result at all.

I think I'll have to make one script for each required tag, but what should I do to transfer the desired info to the relevant tags. TIA

---

<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: [June 12, 2025, 5:41am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/2 "2025-06-12T05:41:07Z")

</div>

> [@irljc](#):
>
> `$regexp(%comment%,'^.*[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9]0-9].*$`

If this is the original expression it could be  
`$regexp(%comment%,'^.*([0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]).*$',$1)`  
So to get the data for DEBUT the action definition would look like this:

 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/c/8/c8e2cc19956edf49291233cce7c8a5b0a252926e.png)

---

<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: [June 12, 2025, 6:06am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/3 "2025-06-12T06:06:58Z")

</div>

> [@irljc](#):
>
> Debuted 11/03/1958 and peaked at #38 on the Hot 100 Chart. Source: Pop Annual. Label/Number: Ace 551. Date Peaked: 12/01/1958."

If this is the text in comment, then I suggest an action of the type "Guess value"  
Source Format: %comment%  
Guessing pattern: `Debuted %debut% and peaked at %peak% on the %chart%. Source: Pop Annual. Label/Number: Ace 551. Date Peaked: %peaked%.`

---

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 6:54am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/4 "2025-06-12T06:54:21Z")

</div>

Many thanks @ohrenkino.

The DEBUT field is now populated, and I missed out the $1 at the end. But Oh how I wish the "Guess Value" action would work. I tried it but none of the fields were populated. Copied another file's comment into your suggestion, but no fields populated either. Pity, it looks a nice clean solution.

---

<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: [June 12, 2025, 7:26am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/5 "2025-06-12T07:26:19Z")

</div>

Please show me the data of at least 3 comment fields.  
The guessing pattern relies on a literal representation.  
So if e.g.

> [@irljc](#):
>
> Source: Pop Annual. Label/Number: Ace 551

varies, then this data may be a case for %dummy% so that if would become  
Guessing pattern: `Debuted %debut% and peaked at %peak% on the %chart%. Source: %dummy%Date Peaked: %peaked%.`

Also, every space and every punctuation mark also matters.

---

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 7:32am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/6 "2025-06-12T07:32:31Z")

</div>

Yeah, I was just trying it out on other tracks, and it doesn't always work. So there's differences in each COMMENT.

File 1  
Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.

File 2  
Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.

File 10  
Debuted 09/15/1958 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: MGM 12677. Date Peaked: 11/10/1958.

I understand the:  
`$regexp(%comment%,'^.*([0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]).*`,$1)`  
bit and can play around with that for other date fields, and I've got an idea for how to get the other fields, but that GUESSING PATTERN is simplicity itself.

---

<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: [June 12, 2025, 7:50am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/7 "2025-06-12T07:50:20Z")

</div>

Have you tried my suggestion

> [@ohrenkino](#):
>
> Guessing pattern: `Debuted %debut% and peaked at %peak% on the %chart%. Source: %dummy%Date Peaked: %peaked%.`

This should ignore the variable part following "Source"

If you want to assign the source to a field "Source, then try  
Guessing pattern: `Debuted %debut% and peaked at %peak% on the %chart%. Source: %source%. Date Peaked: %peaked%.`

---

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 8:12am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/8 "2025-06-12T08:12:36Z")

</div>

> [@ohrenkino](#):
>
> Debuted %debut% and peaked at %peak% on the %chart%. Source: %dummy%Date Peaked: %peaked%.

> [@ohrenkino](#):
>
> Have you tried my suggestion

Yes, and I got the DEBUT and PEAK fields populated, but not DATE PEAKED and CHART NAME. I'll check on how I entered them just in case.

---

<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: [June 12, 2025, 8:28am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/9 "2025-06-12T08:28:11Z")

</div>

please check whether %chart% and %peaked% really should be followed by a dot.  
I just checked it with a regular expression in Convert\>Tag-Tag:  
`$regexp('Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.','Debuted (.*) and peaked at (.*) on the (.*). Source: (.*). Date Peaked: (.*).',$1==$2==$3==$4==$5)`  
and got as result  
`11/30/1957==#1==Hot 100 Chart==Pop Annual. Label/Number: ABC-Paramount 9871==12/28/1957`  
which are the 5 parts from the string that you supplied.

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [June 12, 2025, 8:50am UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/10 "2025-06-12T08:50:06Z")

</div>

> [@ohrenkino](#):
>
> 'Debuted (._) and peaked at (._) on the (._). Source: (._). Date Peaked: (.\*).'

I'd escape the literal dots as `\.` and would also split each field instead of mixing Source: and Label/Number:.

I've adjusted your regex to this:

```auto
Debuted (.*) and peaked at (.*) on the (.*)\. Source: (.*)\. Label\/Number: (.*)\. Date Peaked: (.*)\.

```

Replacing with `$1==$2==$3==$4==$5==$6`  
Would yield the content of each of the fields.

Example input:

```auto
Debuted 11/30/1957 and peaked at #1 on the Hot 100 Chart. Source: Pop Annual. Label/Number: ABC-Paramount 9871. Date Peaked: 12/28/1957.

```

yields:

```auto
11/30/1957==#1==Hot 100 Chart==Pop Annual==ABC-Paramount 9871==12/28/1957

```

@irljc could first use a Format value action with this regex to create a temporary field that holds the values split by `==` and then a trivial guess value action could split this new field into DEBUT, PEAK etc..

3 actions in an action group should do the trick.

1. Format value targeting a temporary tag to filter the content via regex
2. Guess values action to split the result into individual tags
3. Remove fields action to delete the temporary tag

Here's the [regex](https://regex101.com/r/ZicXNx/2) with the provided examples. Should it not work for some of the files, simply adjusting the regex should make this solution more flexible than one that only relies on a single guess values action.

---

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 8:29pm UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/11 "2025-06-12T20:29:40Z")

</div>

@ [ohrenkino](https://community.mp3tag.de/u/ohrenkino)  
I went back and checked the original tags I created, and found two were different from the names I'd used to populate the fields. After correcting them, all fields were populated as required. I HAD checked them earlier, but ... Anyway, it's working as expected now, and there's only a few titles that are not filled. Sorry about the error, 'cause that caused you extra work, but at the same time I learned something from your example. Thank you again for the help. 🕵️‍♂️👍

BTW, the fields are not separated by a "." (dot), so that would not have helped either.

Now to format the dates, but I think I can work that out. First time for everything.

---

<div class="post-metadata">

### Author: ![irljc](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@irljc](https://community.mp3tag.de/u/irljc)
#### Post date: [June 12, 2025, 8:40pm UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/12 "2025-06-12T20:40:15Z")

</div>

@ [Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)

Wow, that's some suggestion. I say that as I don't understand the syntax, and my regex knowledge is very limited. I've copied it and will go over it to see if I can make sense of it.  
Thank you for the time you took to answer, I appreciate it very much. 👍

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [June 12, 2025, 8:57pm UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/13 "2025-06-12T20:57:03Z")

</div>

> [@irljc](#):
>
> I've copied it and will go over it to see if I can make sense of it

Don't bother if the guess values action by @ohrenkino works after all. It's easier and my approach has no advantage over it (if the comment tag follows the example syntax strictly).

If you are interested in how you'd implement the 3 actions that I suggested, I quickly created them (only tested them on a single example file tho).

Action 1:  
Format value:  
Field:

```auto
TEMPSORT

```

Format string:

```auto
$regexp(%comment%,'Debuted (.*) and peaked at (.*) on the (.*)\. Source: (.*)\. Label\/Number: (.*)\. Date Peaked: (.*)\.',$1==$2==$3==$4==$5==$6)

```

Action 2:  
Guess values:  
Source format:

```auto
%tempsort%

```

Guessing pattern:

```auto
%debut%==%peak%==%chart%==%dummy%==%dummy%==%peaked%

```

Action 3:  
Remove fields:  
Fields to remove (semicolon-separated):

```auto
tempsort

```

The upside of this approach is that _should_ there be variation in the syntax of the comment field, the regular expression in the first action could be changed to account for that, making it more flexible.

If you don't want to recreate the actions you can simply drop this into your Mp3tag actions folder:  
[irljc.mta](https://community.mp3tag.de/uploads/short-url/dmzhy0u0I3i75Q5qiV3vXt6vnZo.mta) (391 Bytes)

That's usually located at:

```auto
C:\Users\<USER>\AppData\Roaming\Mp3tag\data\actions

```

---

<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: [June 12, 2025, 9:02pm UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/14 "2025-06-12T21:02:20Z")

</div>

Just a comment:  
The preparation with the regular expression and the guessing of the values could be joined to a single action

Guess value  
Source Format: `$regexp(%comment%,'Debuted (.*) and peaked at (.*) on the (.*)\. Source: (.*)\. Label\/Number: (.*)\. Date Peaked: (.*)\.',$1==$2==$3==$4==$5==$6)`  
Guessing pattern: `%debut%==%peak%==%chart%==%dummy%==%dummy%==%peaked%`

That would save the need for the temporary field (and it's subsequent deletion)

---

<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: [July 12, 2025, 9:03pm UTC](https://community.mp3tag.de/t/populating-a-field-with-info-from-another-field/68822/15 "2025-07-12T21:03:17Z")

</div>

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