# How to copy PORTION of one field to another?

**URL:** https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874
**Category:** Support
**Created:** [December 10, 2007, 6:46pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874 "2007-12-10T18:46:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tbessie](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/a698b9/32.png) [@tbessie](https://community.mp3tag.de/u/tbessie)
#### Post date: [December 10, 2007, 6:46pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/1 "2007-12-10T18:46:23Z")

</div>

Is there any way to apply a regular expression to one field, and then use the results of that regular expression (through parenthesized sub-expressions) as changes to be made in another field?

For example, let's say I have tracks titles that have:

> My Title (Track 1) My Title 2 (Track 2) My Title 3 (Track 90)

And I have a regex:

> ^[^(]\*\(Track ([0-9]\*)\)$

And I want to set the value for the TRACK field to '\1' from the above expression as applied to the TITLE field.

Is there a way I can do this? Also, is there a way to extract values from MULTIPLE fields to use in modifying a target field?

Something like that would be truly wonderful.

- Tim

---

<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: [December 10, 2007, 9:32pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/2 "2007-12-10T21:32:02Z")

</div>

> [@tbessie](#):
>
> ... And I have a regex:
> 
> > ^[^(]\*\(Track ([0-9]\*)\)$
> 
> And I want to set the value for the TRACK field to '\1' from the above expression as applied to the TITLE field. Is there a way I can do this? Also, is there a way to extract values from MULTIPLE fields to use in modifying a target field? Something like that would be truly wonderful. - Tim

You can copy content from one tag to another tag, e. g.  
Actiongroup: **Copy content from one tagfield to another tagfield**  
Action #1  
_Actiontype 5:_ **Format tag field**  
_Field:_ **TAG\_2**  
_Formatstring:_ **%TAG\_1%**

You can run any action against the new tagfield.

DD.20071210.2331.CET

---

<div class="post-metadata">

### Author: ![tbessie](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/a698b9/32.png) [@tbessie](https://community.mp3tag.de/u/tbessie)
#### Post date: [December 10, 2007, 11:07pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/3 "2007-12-10T23:07:39Z")

</div>

> [@DetlevD](#):
>
> You can copy content from one tag to another tag, e. g.  
> Actiongroup: **Copy content from one tagfield to another tagfield**  
> Action #1  
> _Actiontype 5:_ **Format tag field**  
> _Field:_ **TAG\_2**  
> _Formatstring:_ **%TAG\_1%**
> 
> You can run any action against the new tagfield.
> 
> DD.20071210.2331.CET

Hi there, DetlevD...

Well, that is a related thing, but it's not extracting content elements from one tag and transforming a second field based on them.

Say I had one field that had "ABC DEF 123" in it, and another field that had "XYZ HAHAHA 999", and I wanted to copy the digits at the end of the 2nd field and replace the 1st field's digits with them. That kind of thing is not doable with mp3tag, correct?

- Tim

---

<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: [December 10, 2007, 11:25pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/4 "2007-12-10T23:25:51Z")

</div>

> [@tbessie](#):
>
> Hi there, DetlevD...
> 
> Well, that is a related thing, but it's not extracting content elements from one tag and transforming a second field based on them.
> 
> Say I had one field that had "ABC DEF 123" in it, and another field that had "XYZ HAHAHA 999", and I wanted to copy the digits at the end of the 2nd field and replace the 1st field's digits with them. That kind of thing is not doable with mp3tag, correct?
> 
> - Tim

Proposal, quick and dirty, not tested:

TAG\_1 use Format  
"ABC DEF 123"

TAG\_2 use Format  
%TAG\_1%

TAG\_3 use Format  
"XYZ HAHAHA 999"

TAG\_1 use RegExp  
"ABC DEF 123" manipulate it to "123" e. g. $regexp(TAG\_1,^(._?)(\d_)$,$2)

TAG\_2 use RegExp  
"ABC DEF 123" manipulate it to "ABC DEF " e. g. $regexp(TAG\_2,^(._?)(\d_)$,$1)

TAG\_3 use RegExp  
"XYZ HAHAHA 999" manipulate it to "999" e. g. $regexp(TAG\_3,^(._?)(\d_)$,$2)

TAG\_4 use Format  
%\_TAG\_2%%TAG\_3%

You may be able to reduce the number of tag fields.

DD.20071211.0125.CET

---

<div class="post-metadata">

### Author: ![tbessie](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/a698b9/32.png) [@tbessie](https://community.mp3tag.de/u/tbessie)
#### Post date: [December 11, 2007, 7:29am UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/5 "2007-12-11T07:29:40Z")

</div>

Thanks, D -- I'll give those ideas a try -- I appreciate the thought you put into it.  
Do you happen to know if there is a tagging program that supports this kind of really complex  
transformations with regular expressions built in, so that you needn't come up with  
a strategy to do this based on multiple steps or intermediary tags?

- Tim

Moderation: removed unnecessary fullquote

---

<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: [December 15, 2007, 3:45pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/6 "2007-12-15T15:45:05Z")

</div>

> [@tbessie](#):
>
> ... Do you happen to know if there is a tagging program that supports this kind of really complex transformations with regular expressions built in, ...

I would solve this special problem with Mp3tag this way:

Begin Actiongroup **Test\_tbessie**

Action #1  
_Actiontype 5:_ **Format tag field**  
_Field:_ **TBESSIE\_1**  
_Formatstring:_ **ABC÷DEF÷123**

Action #2  
_Actiontype 5:_ **Format tag field**  
_Field:_ **TBESSIE\_2**  
_Formatstring:_ **XYZ÷HAHAHA÷999**

Action #3  
_Actiontype 5:_ **Format tag field**  
_Field:_ **TBESSIE\_3**  
_Formatstring:_ **%TBESSIE\_1%,%TBESSIE\_2%**

Action #4  
_Actiontype 4:_ **Replace with regular expression**  
_Field:_ **TBESSIE\_3**  
_Regular expression:_ **^(._?)(\d_),(._?)(\d_)$**  
_Replace matches with:_ **$1$4**

[\_] case sensitive comparison

Note: Replace one special character ÷ with one space character.  
End Actiongroup **Test\_tbessie** (4 Actions)

This actiongroup gives the result TBESSIE\_3= **ABC DEF 999**.

DD.20071215.1745.CET

---

<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:20pm UTC](https://community.mp3tag.de/t/how-to-copy-portion-of-one-field-to-another/5874/7 "2026-02-09T12:20:38Z")

</div>


