# Tags: Exporting Only a Portion of One Field to Another

**URL:** https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073
**Category:** General Discussion
**Created:** [July 20, 2015, 12:11pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073 "2015-07-20T12:11:57Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 12:11pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/1 "2015-07-20T12:11:57Z")

</div>

If possible, how do I export only a portion of the description in a tag field to another field? The string I wish to export is continuous, but it may vary in the number of characters and its position within the tag field- mostly the position will be at the beginning or at the end of the tag field.

A typical example would be where I would like to export the Composer of a song from the Title Field and move or copy it to the Composer Field. Here are two titles with the Composer at the beginning of the title, but it could be positioned anywhere else.

1. Verdi: Preludio Atto I (La Traviata)
2. Mozart: Madamina, Il Catalogo E Questo (Don Giovanni)

Thank you.

---

<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: [July 20, 2015, 12:50pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/2 "2015-07-20T12:50:12Z")

</div>

> [@ragtag](#):
>
> If possible, how do I export only a portion of the description in a tag field to another field? The string I wish to export is continuous, but it may vary in the number of characters and its position within the tag field- mostly the position will be at the beginning or at the end of the tag field. ...

You may apply an action "Guess values" with a fitting pattern, which may vary depending on the given format of the TITLE string.

Action "Guess values"  
Source format: %TITLE%  
Guessing pattern: %COMPOSER%:%DUMMY%

From:  
TITLE = Verdi: Preludio Atto I (La Traviata)  
To:  
TITLE = Verdi: Preludio Atto I (La Traviata)  
COMPOSER = Verdi

See also ...  
[https://www.google.de/search?q=site%3Aforum...de+Guess+values](https://www.google.de/search?q=site%3Aforums.mp3tag.de+Guess+values)

For a sophisticated example see there ...  
[/t/12651/1](https://community.mp3tag.de/t/12651/1)

DD.20150720.1718.CEST

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 1:04pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/3 "2015-07-20T13:04:12Z")

</div>

> [@DetlevD](#):
>
> You may apply an action "Guess values" with a fitting pattern, which may vary depending on the given format of the TITLE string.
> 
> Action "Guess values"  
> Source format: %TITLE%  
> Guessing pattern: %COMPOSER%:%DUMMY%
> 
> From:  
> TITLE = Verdi: Preludio Atto I (La Traviata)  
> To:  
> TITLE = Verdi: Preludio Atto I (La Traviata)  
> COMPOSER = Verdi
> 
> DD.20150720.1656.CEST

Thank you very much DetlevD. I am going to apply it to learn how it works.

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 1:15pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/4 "2015-07-20T13:15:32Z")

</div>

I have applied your proposal DetlevD, and it worked just fine in this particular instance. However, what if there are no discernible characters available in the field, for example no punctuation marks such as the colon after the name of the composer? Example:

1. Verdi Preludio Atto I (La Traviata)
2. Mozart Madamina, Il Catalogo E Questo (Don Giovanni)

Thank you.

---

<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: [July 20, 2015, 1:30pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/5 "2015-07-20T13:30:41Z")

</div>

> [@ragtag](#):
>
> ... it worked just fine in this particular instance. However, what if there are no discernible characters available in the field, for example no punctuation marks such as the colon after the name of the composer? ...

You have different options to "repair" this initial situation ...

- Use as the first split point the space character behind the artist name "Verdi".  
Action "Guess values"  
Source format: %TITLE%  
Guessing pattern: %COMPOSER% %DUMMY%  
This works for one word composer names only.

- At first rename "Verdi" to "Verdi:" ... or something alike, ... then guess values ...  
Action "Guess values"  
Source format: $replace(%TITLE%,'Verdi ','Verdi:')  
Guessing pattern: %COMPOSER%:%DUMMY%

- There might be other textual tricks possible ...  
Action "Guess values"  
Source format: $replace(%TITLE%,'Verdi ',':Verdi:')  
Guessing pattern: %DUMMY%:%COMPOSER%:%DUMMY%

DD.20150720.1731.CEST, DD.20150720.1822.CEST

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 2:01pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/6 "2015-07-20T14:01:45Z")

</div>

> [@DetlevD](#):
>
> You have different options to "repair" this initial situation ...
> 
> - Use as the first split point the space character behind the artist name "Verdi".  
> %ARTIST% %DUMMY%  
> This works for one word artist names only.
> 
> - At first rename "Verdi" to "Verdi:" ... or something, ... then guess values ...  
> %ARTIST%:%DUMMY%
> 
> - there maybe other textual tricks possible
> 
> DD.20150720.1731.CEST

Thank you DetlevD. Will a regular expression not achieve what I need to do? If there is a way to build to a regular expression to cover most instances of what I need to do, I will surely appreciate a few working examples. 🙂

---

<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: [July 20, 2015, 2:13pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/7 "2015-07-20T14:13:23Z")

</div>

> [@ragtag](#):
>
> ... Will a regular expression not achieve what I need to do? If there is a way to build to a regular expression to cover most instances of what I need to do, I will surely appreciate a few working examples. 🙂

Yes, you have to describe and lay out all different cases, in order to create and get at last an universal regular expression, if ever possible.  
I assume that the basic problem remains the same, ...  
which is the need of having distinct separator characters, ...  
or systematically structured string data, ...  
to describe where to split resp. what to extract.  
See also links in post #2 above.

DD.20150720.1813.CEST

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 2:53pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/8 "2015-07-20T14:53:14Z")

</div>

> [@](#):
>
> DetlevD ...which is the need of having distinct separator characters

I agree and thank you for you for your guidance, DetlevD. I appreciate it.

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 20, 2015, 3:05pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/9 "2015-07-20T15:05:57Z")

</div>

There is one more thing I need help with, please:

From my earlier examples:

Verdi: Preludio Atto I (La Traviata)

How do I move the name "Verdi" in the beginning of the field to the end of the same field, and if "Verdi" was at the end, how do I move it to the front?

Thank you.

[Edit] I found [this](https://community.mp3tag.de/t/12769/1) which I am going to try 🙂

---

<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: [July 21, 2015, 11:48am UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/10 "2015-07-21T11:48:33Z")

</div>

> [@ragtag](#):
>
> There is one more thing I need help with, please: From my earlier examples: Verdi: Preludio Atto I (La Traviata)  
> How do I move the name "Verdi" in the beginning of the field to the end of the same field, and if "Verdi" was at the end, how do I move it to the front? ...

Consider this ...  
TITLE = Verdi: Preludio Atto I (La Traviata)

Formatstring: **%TITLE%', '%TITLE%**

 **'Verdi: Preludio Atto I (La Traviata)' + ', ' + 'Verdi: Preludio Atto I (La Traviata)'** **Action: Guess values Source format : %TITLE%', '%TITLE% Guessing pattern: %DUMMY%: %TITLE%:%DUMMY% TITLE = ... From: Verdi: Preludio Atto I (La Traviata) To : Preludio Atto I (La Traviata), Verdi Action: Guess values Source format : %TITLE%': '%TITLE% Guessing pattern: %DUMMY%, %TITLE%,%DUMMY% TITLE = ... From: Preludio Atto I (La Traviata), Verdi To : Verdi: Preludio Atto I (La Traviata)**

DD.20150721.1624.CEST

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 21, 2015, 12:51pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/11 "2015-07-21T12:51:48Z")

</div>

> [@DetlevD](#):
>
> Consider this ...  
> TITLE = Verdi: Preludio Atto I (La Traviata)
> 
> Formatstring: **%TITLE%', '%TITLE%**
> 
> **'Verdi: Preludio Atto I (La Traviata)' + ', ' + 'Verdi: Preludio Atto I (La Traviata)'** **Action: Guess values Source format : %TITLE%', '%TITLE% Guessing pattern: %DUMMY%: %TITLE%:%DUMMY% TITLE = ... From: Verdi: Preludio Atto I (La Traviata) To : Preludio Atto I (La Traviata), Verdi Action: Guess values Source format : %TITLE%': '%TITLE% Guessing pattern: %DUMMY%, %TITLE%,%DUMMY% TITLE = ... From: Preludio Atto I (La Traviata), Verdi To : Verdi: Preludio Atto I (La Traviata)**
> 
> DD.20150721.1624.CEST

Thank you once again, DetlevD, you have once again saved the day. I did try to figure it out on my own before your response, but I failed miserably at it. Cheers. ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 21, 2015, 1:38pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/12 "2015-07-21T13:38:28Z")

</div>

I experimented on my own to rearrange the TITLE description, but I failed to adapt your examples to get the desired result. Using our previous example, I would like to rename it thus:

TITLE = Verdi: Preludio Atto I (La Traviata)  
_to:_  
TITLE = Preludio Atto I (La Traviata) {Verdi}

_My best effort delivered this result:_  
TITLE = Preludio Atto I (La Traviata){} Verdi

_- using Source Format:_ %TITLE%' {} '%TITLE%

Where did I go wrong?

---

<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: [July 21, 2015, 3:34pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/13 "2015-07-21T15:34:12Z")

</div>

I think that the the "Guess values" action is not always the best to manipulate one field.  
For your example I could think of at least 2 approaches.  
One uses the "Guess values" again but moves the "Verdi" to composer first:  
Guess value for TITLE:  
Guessing pattern: %composer%: %title%  
and next perform an action of the type "Format value" for TITLE:  
Format string: %title% {%composer%}

Alternatively, you could do without filling composer and move the part in front of the colon to the parenthesis:  
"Replace with regular expression" for TITLE  
Search string: (._): (._)  
Replace string: $2 {$1}  
If you want to transform one pattern into

---

<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: [July 21, 2015, 4:04pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/14 "2015-07-21T16:04:41Z")

</div>

> [@ragtag](#):
>
> I experimented on my own ... Where did I go wrong?

The basic rule is ... divide a complex task into several steps of less complexity.  
Once the text ...  
"Verdi: Preludio Atto I (La Traviata)"  
has been converted to ...  
"Preludio Atto I (La Traviata), Verdi"  
by the "guess values" proposal ...  
then format the composer name ... from ", Verdi" to " {Verdi}".

This can be done for this special case by ...

**Action: Format value Field : TITLE Formatstring: $replace(%TITLE%,', Verdi',' {Verdi}')**

... or more general ... using a regular expression ...

**Action: Format value Field : TITLE Formatstring: $regexp(%TITLE%,',\s\*(.+?)$',' {$1}')**

DD.20150721.2006.CEST

If you want to do it all in one go, then try the following regular expression ...

**Action: Format value Field : TITLE Formatstring: $regexp(%TITLE%,'^(.+?):\s\*(.+?)$','$2 {$1}') From: Verdi: Preludio Atto I (La Traviata) To : Preludio Atto I (La Traviata) {Verdi}**

... and the other way round ...

**Action: Format value Field : TITLE Formatstring: $regexp(%TITLE%,'^(.+?)\s\*{(.+?)}$','$2: $1') From: Preludio Atto I (La Traviata) {Verdi} To : Verdi: Preludio Atto I (La Traviata)**

DD.20150721.2026.CEST

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 21, 2015, 4:54pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/15 "2015-07-21T16:54:45Z")

</div>

Thank you to you both, ohrenkino and DetlevD. I deeply appreciate your time and help.

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 21, 2015, 5:15pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/16 "2015-07-21T17:15:05Z")

</div>

> [@ohrenkino](#):
>
> I think that the the "Guess values" action is not always the best to manipulate one field.  
> For your example I could think of at least 2 approaches.  
> One uses the "Guess values" again but moves the "Verdi" to composer first:  
> Guess value for TITLE:  
> Guessing pattern: %composer%: %title%  
> and next perform an action of the type "Format value" for TITLE:  
> Format string: %title% {%composer%}
> 
> Alternatively, you could do without filling composer and move the part in front of the colon to the parenthesis:  
> "Replace with regular expression" for TITLE  
> Search string: (._): (._)  
> Replace string: $2 {$1}  
> If you want to transform one pattern into

Your message seems to have been truncated, ohrenkino.

---

<div class="post-metadata">

### Author: ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)
#### Post date: [July 21, 2015, 5:16pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/17 "2015-07-21T17:16:04Z")

</div>

I will take me some time to digest and test all your recommendations. Thanks again.

---

<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: [July 21, 2015, 5:51pm UTC](https://community.mp3tag.de/t/tags-exporting-only-a-portion-of-one-field-to-another/17073/18 "2015-07-21T17:51:13Z")

</div>

> [@ragtag](#):
>
> Your message seems to have been truncated, ohrenkino.

Yes and no: that is a leftover from a former idea and apparently I did not scroll to the end before I clicked send.  
So in short: thanks but please ignore that sentence.
