# Split COMMENT to multiple fields

**URL:** https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651
**Category:** Support
**Created:** [November 1, 2011, 10:27am UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651 "2011-11-01T10:27:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![reverbit](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/82dd89/32.png) [@reverbit](https://community.mp3tag.de/u/reverbit)
#### Post date: [November 1, 2011, 10:27am UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/1 "2011-11-01T10:27:06Z")

</div>

Hello!

All my music has a COMMENT tag, which is formatted like this:

YEAROFRELEASE LABEL - CATALOGNO - DG DISCOGS\_ID  
(example: 1991 Columbia - 468214 2 - DG 1799201)

But now I want to split that information into multiple tags. I was wondering if someone could help me do that, because I'm not that great at using regexp...

Thanks in advance!

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [November 1, 2011, 2:10pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/2 "2011-11-01T14:10:36Z")

</div>

> [@reverbit](#):
>
> Hello!
> 
> All my music has a COMMENT tag, which is formatted like this:
> 
> YEAROFRELEASE LABEL - CATALOGNO - DG DISCOGS\_ID  
> (example: 1991 Columbia - 468214 2 - DG 1799201)

Hi, welcome to the forum,

Guess values is the one for this particular task. And a simple reg exp command to delete everything in the comment field afterwards.

Make sure action #2 is below the guess values one.

Do not use action #2 if you want to retain the information within the comment field.

Action #1:  
_Action type:_ **Guess values**  
_Source format:_ **%comment%**  
_Guessing pattern:_ **%year% %publisher% - %catalog #% - %discogs\_release\_id%**

Action #2:  
_Action type:_ **Replace with regular expression**  
_Field:_ **COMMENT**  
_Regular expression:_ **.+**  
_Replace matches with:_

[] case-sensitive comparison

---

<div class="post-metadata">

### Author: ![reverbit](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/82dd89/32.png) [@reverbit](https://community.mp3tag.de/u/reverbit)
#### Post date: [November 2, 2011, 6:21pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/3 "2011-11-02T18:21:08Z")

</div>

> [@stevehero](#):
>
> Hi, welcome to the forum,
> 
> Guess values is the one for this particular task. And a simple reg exp command to delete everything in the comment field afterwards.
> 
> Make sure action #2 is below the guess values one.
> 
> Do not use action #2 if you want to retain the information within the comment field.
> 
> Action #1:  
> _Action type:_ **Guess values**  
> _Source format:_ **%comment%**  
> _Guessing pattern:_ **%year% %publisher% - %catalog #% - %discogs\_release\_id%**
> 
> Action #2:  
> _Action type:_ **Replace with regular expression**  
> _Field:_ **COMMENT**  
> _Regular expression:_ **.+**  
> _Replace matches with:_
> 
> [] case-sensitive comparison

Thanks, that worked just fine! Just a question, is it possible to use regexp syntax in Guess values? (e.g. "20[0-9][0-9]")

---

<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: [November 3, 2011, 4:58pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/4 "2011-11-03T16:58:59Z")

</div>

> [@reverbit](#):
>
> Thanks, that worked just fine! Just a question, is it possible to use regexp syntax in Guess values? (e.g. "20[0-9][0-9]")

I think, the answer might be "no".  
But you can offer a real world example and we will see what the problem is and may help to solve.

DD.20111103.1900.CET

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [November 3, 2011, 5:10pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/5 "2011-11-03T17:10:05Z")

</div>

> [@reverbit](#):
>
> Thanks, that worked just fine! Just a question, is it possible to use regexp syntax in Guess values? (e.g. "20[0-9][0-9]")

You can you $regexp in the _Sourceformat_ line, not in the _Guessing Pattern_.

e.g. you can use:  
_Sourceformat_: **$regexp(%comment%,'20****[0-9][0-9]',20xx)**  
And refer to it with **20xx** in the _Guessing Pattern_ to all numbers from 2000 to 2099. But you can't write the numbers that way.

_Sourceformat_: **$regexp(%comment%,'(20[0-9][0-9])',\<YEAR:$1\>)**  
And refer to it with **\<YEAR:%year%\>** in the _Guessing Pattern_. This way you can write it.

Or you don't du $regexp and use just " **20%dummy%**" in the _Guessing Pattern_, if you don't want to write it anywhere. (without quotationmarks, just to show the trailing space)

As DelevD said, it depends on what you are going to do.

---

<div class="post-metadata">

### Author: ![reverbit](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/82dd89/32.png) [@reverbit](https://community.mp3tag.de/u/reverbit)
#### Post date: [November 4, 2011, 9:38pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/6 "2011-11-04T21:38:36Z")

</div>

> [@DetlevD](#):
>
> I think, the answer might be "no".  
> But you can offer a real world example and we will see what the problem is and may help to solve.
> 
> DD.20111103.1900.CET

A real world example would be: "24/96 Vinyl Rip - aksman 2011 - 1999 Speakers Corner SP-3647 - DG 2513725" in COMMENT.

From this I wanted to extract "24/96 Vinyl Rip" to FORMAT, aksman to RIPPER, 2011 to RIPYEAR, 1999 to RELEASEYEAR, Speakers Corner to PUBLISHER, SP-3647 to CATALOG # and 2513725 to DISCOGS\_RELEASE\_ID.

I can manually introduce a " - " to separate the label from the catalog # if that simplifies the process.

---

<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: [November 5, 2011, 3:15am UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/7 "2011-11-05T03:15:59Z")

</div>

> [@reverbit](#):
>
> A real world example would be: "24/96 Vinyl Rip - aksman 2011 - 1999 Speakers Corner SP-3647 - DG 2513725" in COMMENT.  
> From this I wanted to extract "24/96 Vinyl Rip" to FORMAT, aksman to RIPPER, 2011 to RIPYEAR, 1999 to RELEASEYEAR, Speakers Corner to PUBLISHER, SP-3647 to CATALOG # and 2513725 to DISCOGS\_RELEASE\_ID. ...

> [@reverbit](#):
>
> ... I can manually introduce a " - " to separate the label from the catalog # if that simplifies the process.

Yes, this may help, but check out the following proposal, maybe it can handle your real world example.

We use an action "Guess values".  
To let Mp3tag guess values for these seven tag-fields ...

**FORMAT, RIPPER, RIPYEAR, RELEASEYEAR, PUBLISHER, CATALOG #, DISCOGS\_RELEASE\_ID**

... from this input string ...

**24/96 Vinyl Rip - aksman 2011 - 1999 Speakers Corner SP-3647 - DG 2513725**

... we need to prepare or modify the given input string to fit to a splitting rule, that will allow to guess values.

There are some ways to modify the input string to fit to a splitting rule, here is one ...

**$regexp(%COMMENT%,'^(.+?) - (.+?) (\d{4}) - (\d{4}) (.+) (.+?\d+) - (.+?)$','$1\_$2\_$3\_$4\_$5\_$6\_$7')**

This will change the input string to ...

**24/96 Vinyl Rip\_aksman\_2011\_1999\_Speakers Corner\_SP-3647\_DG 2513725**

The corresponding format string looks like ...

**%FORMAT%\_%RIPPER%\_%RIPYEAR%\_%RELEASEYEAR%\_%PUBLISHER%\_%CATALOG #%\_%DISCOGS\_RELEASE\_ID%**

The result will be ... seven tag-fields filled this way ...

**Tag-Field: CATALOG #**

**Value: SP-3647  
Tag-Field: DISCOGS\_RELEASE\_ID  
Value: DG 2513725  
Tag-Field: FORMAT  
Value: 24/96 Vinyl Rip  
Tag-Field: PUBLISHER  
Value: Speakers Corner  
Tag-Field: RELEASEYEAR  
Value: 1999  
Tag-Field: RIPPER  
Value: aksman  
Tag-Field: RIPYEAR  
Value: 2011**

 

Put it all together ...  
Action: Guess values  
Source format:

 **$regexp(%COMMENT%,'^(.+?) - (.+?) (\d{4}) - (\d{4}) (.+) (.+?\d+) - (.+?)$','$1\_$2\_$3\_$4\_$5\_$6\_$7')** 

Format string:

 **%FORMAT%\_%RIPPER%\_%RIPYEAR%\_%RELEASEYEAR%\_%PUBLISHER%\_%CATALOG #%\_%DISCOGS\_RELEASE\_ID%** 

You do not need to do the splitting by this preprocessing method using a complicated regular expression.  
At the first step you can simply split the given input string into its obvious four components by filling regular and temporary tag-fields.  
In following steps you can split the temporary tag-fields to get the seven tag-fields as wanted.

 

Example for an Action Group:

 Begin Action Group **Test\_2011#20111105.GuessValues** 

Action #1  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%COMMENT%**  
_Guessing pattern:_ **%FORMAT% - %TMP\_RIP% - %TMP\_PUB% - %DISCOGS\_RELEASE\_ID%**

 

Action #2  
_Actiontype 4:_ **Replace with regular expression**  
_Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **TMP\_RIP**  
_Regular expression \_:_ **^(.+)\s(\d{4})$**  
_Replace matches with:_ **$1 - $2**

 [\_] Case sensitive comparison 

Action #3  
_Actiontype 4:_ **Replace with regular expression**  
_Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **TMP\_PUB**  
_Regular expression \_:_ **^(\d{4})\s(.+)\s(.+)$**  
_Replace matches with:_ **$1 - $2 - $3**

 [\_] Case sensitive comparison 

Action #4  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%TMP\_RIP%**  
_Guessing pattern:_ **%RIPPER% - %RIPYEAR%**

 

Action #5  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%TMP\_PUB%**  
_Guessing pattern:_ **%RELEASEYEAR% - %PUBLISHER% - %CATALOG #%**

 

Action #6  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_RIP;TMP\_PUB**

 

End Action Group **Test\_2011#20111105.GuessValues** (6 Actions)

 

DD.20111105.0840.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:23pm UTC](https://community.mp3tag.de/t/split-comment-to-multiple-fields/12651/8 "2026-02-09T12:23:25Z")

</div>


