# Replace Data in Embedded Cuesheet

**URL:** https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332
**Category:** Support
**Created:** [December 23, 2010, 4:41pm UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332 "2010-12-23T16:41:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Flasshe](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flasshe/32/341_2.png) [@Flasshe](https://community.mp3tag.de/u/Flasshe)
#### Post date: [December 23, 2010, 4:41pm UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/1 "2010-12-23T16:41:50Z")

</div>

First of all, let me say how much I love mp3tag. I've been using it for over a year and it's one of the most robust pieces of software I've ever used. Florian, you have a wonderful product.

I would like to know if this is possible. I have .flac files with embedded cuesheets (created by EAC/REACT2). Could I use an action in mp3tag to replace some specific data within the cuesheet (the metadata CUESHEET tag) with some other data?

Specifically, I would like to add the year of the album to the beginning of the filename (the FILE field). For example, I would want to change this (the first part of CUESHEET):

REM DISCNUMBER 1  
REM TOTALDISCS 1  
REM GENRE Rock/Pop  
REM DATE 1994  
REM DISCID A70C310B  
REM COMMENT "ExactAudioCopy v0.99pb5"  
PERFORMER "Oasis"  
TITLE "Definitely Maybe"  
FILE "Oasis - Definitely Maybe.flac" WAVE  
TRACK 01 AUDIO  
[...]

to this:

REM DISCNUMBER 1  
REM TOTALDISCS 1  
REM GENRE Rock/Pop  
REM DATE 1994  
REM DISCID A70C310B  
REM COMMENT "ExactAudioCopy v0.99pb5"  
PERFORMER "Oasis"  
TITLE "Definitely Maybe"  
FILE "Oasis - [1994] Definitely Maybe.flac" WAVE  
TRACK 01 AUDIO

[...]

Leaving everything the same except the FILE field.

Thanks much!

---

<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 24, 2010, 10:36am UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/2 "2010-12-24T10:36:32Z")

</div>

> [@Flasshe](#):
>
> ... Could I use an action in mp3tag to replace some specific data within the cuesheet (the metadata CUESHEET tag) with some other data?  
> Specifically, I would like to add the year of the album to the beginning of the filename (the FILE field). For example, I would want to change this (the first part of CUESHEET):  
> REM DISCNUMBER 1  
> REM TOTALDISCS 1  
> REM GENRE Rock/Pop  
> REM DATE 1994  
> REM DISCID A70C310B  
> REM COMMENT "ExactAudioCopy v0.99pb5"  
> PERFORMER "Oasis"  
> TITLE "Definitely Maybe"  
> FILE "Oasis - Definitely Maybe.flac" WAVE  
> TRACK 01 AUDIO  
> [...]  
> to this:  
> REM DISCNUMBER 1  
> REM TOTALDISCS 1  
> REM GENRE Rock/Pop  
> REM DATE 1994  
> REM DISCID A70C310B  
> REM COMMENT "ExactAudioCopy v0.99pb5"  
> PERFORMER "Oasis"  
> TITLE "Definitely Maybe"  
> FILE "Oasis - [1994] Definitely Maybe.flac" WAVE  
> TRACK 01 AUDIO  
> [...]  
> Leaving everything the same except the FILE field. ...

Supposing the cuesheet text data is available in a tag-field named CUESHEET, and the year value can be derived from the statement REM DATE, then this action can help:

Begin Action Group **Test 2010#20101224.Flasshe** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **TMP\_CUESHEET**  
_Formatstring:_ **$replace($regexp(%CUESHEET%,'^(._?)(FILE÷".+?÷-)(.+?"÷WAVE)(._?)$','$1$2÷[YYYY]$3$4'),'[YYYY]',$regexp(%CUESHEET%,'^._?REM÷DATE÷(\d\d\d\d)._$','[$1]'))**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **Test 2010#20101224.Flasshe** (1 Action)

 

This will create a temporary tag-field TMP\_CUESHEET just for the test purpose.  
If it works fine, then the original CUESHEET tag-field can be overwritten by the TMP\_CUESHEET content, and the tag-field TMP\_CUESHEET can be removed.

 

Or the other way is to overwrite the original content of the tag-field CUESHEET with the previous action in one go, using the tag-field CUESHEET as target.

 

 ![](https://community.mp3tag.de/uploads/default/original/2X/c/c3e22cb49c0e6ad35c1b88d9c3c6c9feebda92fa.png)  
  
  ![](https://community.mp3tag.de/uploads/default/original/2X/2/2ba67595ab7be402718baa4ebe71731b01f424de.png)  

 

DD.20101224.1238.CET

 

 ![](https://community.mp3tag.de/uploads/default/original/2X/c/c3e22cb49c0e6ad35c1b88d9c3c6c9feebda92fa.png)  

 

 ![](https://community.mp3tag.de/uploads/default/original/2X/2/2ba67595ab7be402718baa4ebe71731b01f424de.png)

---

<div class="post-metadata">

### Author: ![Flasshe](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flasshe/32/341_2.png) [@Flasshe](https://community.mp3tag.de/u/Flasshe)
#### Post date: [December 24, 2010, 2:42pm UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/3 "2010-12-24T14:42:22Z")

</div>

That is exactly what I wanted. Works great!! Thanks so much!

---

<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 25, 2010, 5:15am UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/4 "2010-12-25T05:15:56Z")

</div>

The Formatstring can be done shorter.

Begin Action Group **Test 2010#20101224.Flasshe.2** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **TMP\_CUESHEET**  
_Formatstring:_ **$regexp(%CUESHEET%,'^(._?REM÷DATE÷)(\d\d\d\d)(._?FILE÷".+?÷-)(.+?"÷WAVE)(.\*?)$','$1$2$3÷[$2]$4')**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **Test 2010#20101224.Flasshe.2** (1 Action)

DD.20101225.0717.CET

---

<div class="post-metadata">

### Author: ![Flasshe](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flasshe/32/341_2.png) [@Flasshe](https://community.mp3tag.de/u/Flasshe)
#### Post date: [December 25, 2010, 11:47pm UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/5 "2010-12-25T23:47:43Z")

</div>

Thanks, that worked as well. My renaming is complete and I'm very happy today!

---

<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:22pm UTC](https://community.mp3tag.de/t/replace-data-in-embedded-cuesheet/11332/6 "2026-02-09T12:22:46Z")

</div>


