# Editing lengthy Comment tags using Action

**URL:** <https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755>\
**Category:** Support\
**Created:** [March 27, 2015, 7:19am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755 "2015-03-27T07:19:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 27, 2015, 7:19am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/1 "2015-03-27T07:19:45Z")

</div>

I have a number actions set up for my subscribed podcasts, with each Action formatting the Mp3s specific to the podcast.

There's a podcast I recently created an Action for which I change the filename, title, year, etc from existing info in the tags. However for the Comment tag I'm not so sure how to cut parts from it.

Tried using $replace() but it replaces the entire tag. Regular expression seems like a better use but I couldn't find the right way to express it. Is there some template I could use to list lines to be removed from a tag?

The original Comment tag:

> No Agenda Episode 707 - "Bandwich"
> 
> ```
> Executive Producers: Baron AJ Rystad, Anonymous
> 
> Associate Executive Producers: Lynton Harry, Baronetess Dame Francine Hardaway
> 
> Club 707 Member: Baron AJ Rystad
> 
> Become a member of the 708 Club, support the show here
> 
> Sign Up for the newsletter
> 
> Thanks to MartinJJ for the backup recoding of 707
> 
> Art By: lindhartsen 
> 
> ShowNotes Archive of links and Assets (clips etc) 707.noagendanotes.com
> 
> New: Directory Archive of Shownotes (includes all audio and video assets used) archive.noagendanotes.com
> 
> The No Agenda News Network- noagendanewsnetwork.com
> 
> RSS Podcast Feed 
> 
> Get the No Agenda News App for your iPhone and iPad
> 
> Get the NoAgendDroid app for your Android Phone
> 
> Torrents of each episode via BitLove
> 
> New! BitTorrent Sync the No Agenda Show
> 
> Last Modified 03/26/2015 15:04:34
> This page created with the FreedomController</blockquote>
> 
> ```
> 
> And how I'm wanting to edit it using an Action, removing the leading whitespace and a number of unnecessary text lines. Depending on the episode there can be additional 'thanks' lines, but the lines I'm wanting to remove stay the same.
> 
> > No Agenda Episode 707 - "Bandwich"
> > 
> > ```
> > Executive Producers: Baron AJ Rystad, Anonymous
> > 
> > Associate Executive Producers: Lynton Harry, Baronetess Dame Francine Hardaway
> > 
> > Club 707 Member: Baron AJ Rystad
> > 
> > Thanks to MartinJJ for the backup recoding of 707
> > 
> > Art By: lindhartsen 
> > 
> > ShowNotes Archive of links and Assets (clips etc) 707.noagendanotes.com
> > 
> > Last Modified 03/26/2015 15:04:34</blockquote>
> > 
> > ```
> > 
> > Any help would be appreciated 🙂

---

<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:** [March 27, 2015, 8:47am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/2 "2015-03-27T08:47:01Z")

</div>

> [@LaurenBacall](#):
>
> I have a number actions set up for my subscribed podcasts, with each Action formatting the Mp3s specific to the podcast.  
> There's a podcast I recently created an Action for which I change the filename, title, year, etc from existing info in the tags. However for the Comment tag I'm not so sure how to cut parts from it. ...

In which file format do you receive the podcast?  
Please provide the original text script code from the podcast message, ...  
it would make it easier to think about your request.

If you are looking only to lines of the format "key:value", ...  
it might be easy to reduce the incoming text to lines having this format.

DD.20150327.1050.CET

---

<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:** [March 27, 2015, 8:56am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/3 "2015-03-27T08:56:24Z")

</div>

> [@LaurenBacall](#):
>
> ...
> 
> The original Comment tag:
> 
> No Agenda Episode 707 - "Bandwich"
> 
> ```
> Executive Producers: Baron AJ Rystad, Anonymous
> 
> Associate Executive Producers: Lynton Harry, Baronetess Dame Francine Hardaway
> 
> Club 707 Member: Baron AJ Rystad
> 
> Become a member of the 708 Club, support the show here
> 
> Sign Up for the newsletter
> 
> Thanks to MartinJJ for the backup recoding of 707
> 
> Art By: lindhartsen 
> 
> ShowNotes Archive of links and Assets (clips etc) 707.noagendanotes.com
> 
> New: Directory Archive of Shownotes (includes all audio and video assets used) archive.noagendanotes.com
> 
> The No Agenda News Network- noagendanewsnetwork.com
> 
> RSS Podcast Feed 
> 
> Get the No Agenda News App for your iPhone and iPad
> 
> Get the NoAgendDroid app for your Android Phone
> 
> Torrents of each episode via BitLove
> 
> New! BitTorrent Sync the No Agenda Show
> 
> Last Modified 03/26/2015 15:04:34
> This page created with the FreedomController...
> 
> ```
> 
> ...No Agenda Episode 707 - "Bandwich"
> 
> Executive Producers: Baron AJ Rystad, Anonymous
> 
> Associate Executive Producers: Lynton Harry, Baronetess Dame Francine Hardaway
> 
> Club 707 Member: Baron AJ Rystad
> 
> Thanks to MartinJJ for the backup recoding of 707
> 
> Art By: lindhartsen
> 
> ShowNotes Archive of links and Assets (clips etc) [707.noagendanotes.com](http://707.noagendanotes.com)
> 
> Last Modified 03/26/2015 15:04:34[/code][/indent]
> 
> Any help would be appreciated 🙂

First of all, you could replace (with regular expression) all double linefeeds with just a single:  
Search string:(\r\n)\r\n  
Replace string: $1

If you have certain keywords that indicate the text passage you want to delete and also keywords that mark the border to passages you want to keep then you could apply actions of the type "Guess value" in which you define the 2 keep strings, save them to a user-defined field and then merge these 2 fields back to the comment field.  
E.g.  
Guessing pattern: %keepstring\_start%New:%dummy%Last Modified%keepstring\_end%

Format value for try\_comment  
Format string: %keepstring\_start%$char(13)$char(10)Last Modified%keepstring\_end%

You find the result then in try\_comment and can check if the pattern is OK.

if you think it works:  
Action of the type format value for COMMENT  
format string %try\_comment%

Action of the type Remove fields for KEEPSTRING\_START;KEEPSTRING\_END;TRY\_COMMENT

Just an idea - and probably only one of so many ways to do it.

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 27, 2015, 9:26am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/4 "2015-03-27T09:26:58Z")

</div>

> [@DetlevD](#):
>
> In which file format do you receive the podcast?  
> Please provide the original text script code from the podcast message, ...  
> it would make it easier to think about your request.
> 
> If you are looking only to lines of the format "key:value", ...  
> it might be easy to reduce the incoming text to lines having this format.

So the original file downloaded is an Mp3. The Action is then run on the Mp3 to format some of the tags. All the tags and information is contained within the original file downloaded.

I've uploaded a clip of a podcast episode with the original tags, as well attached the current version of the action I use for formatting to this post. Hopefully it's what you wanted to know.

[Podcast clip (800kb)](http://a.pomf.se/cvalug.zip) [it's zipped because the host renames files]

> [@ohrenkino](#):
>
> First of all, you could replace (with regular expression) all double linefeeds with just a single:  
> Search string:(\r\n)\r\n  
> Replace string: $1

Thanks for the tip. Tried this but it cuts all new line spaces between lines while leaving the first new line space. I'll have to look into modifying the command to get it right 🙂

> [@ohrenkino](#):
>
> If you have certain keywords that indicate the text passage you want to delete and also keywords that mark the border to passages you want to keep then you could apply actions of the type "Guess value" in which you define the 2 keep strings, save them to a user-defined field and then merge these 2 fields back to the comment field.
> 
> E.g. Guessing pattern: %keepstring\_start%New:%dummy%Last Modified%keepstring\_end%
> 
> ...
> 
> Just an idea - and probably only one of so many ways to do it.

Was thinking some border between sections may be a way of doing it. Thing is that the Comment text changes, so it's not always clear where they'll begin. Edit: actually I perhaps could use this for single lines, too if the 'end' can be a newline (although it would result in a lot of custom tags 😛).

[Podcasts\_No\_Agenda.mta](https://community.mp3tag.de/uploads/default/original/2X/8/825fb49c0f150d7d034afb7f52a403d3deab3037.mta) (524 Bytes)

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 27, 2015, 1:35pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/5 "2015-03-27T13:35:36Z")

</div>

Got it working, yay. Thanks to ohrenkino for the tips and examples.

Stripped the new lines completely, then added one new line break per line. Next split the text into 2 parts then merged together within the Comment tag. Fingers crossed it doesn't break on future episodes.

Used a bit of Regex to cut the last line, too:

Field: COMMENT  
Regular expression: (^._)This page created with the FreedomController(._$)  
Replace matches with: $1$2

---

<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:** [March 27, 2015, 2:37pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/6 "2015-03-27T14:37:29Z")

</div>

> [@LaurenBacall](#):
>
> Got it working, yay. ...

Although you are already satisfied, ...  
I have attached a Mp3tag action group for your disposal and testing.  
[Test2015\_20150327.LaurenBacall.mta](https://community.mp3tag.de/uploads/default/original/2X/b/b926ed84b2648a9e200c20d3a3a8d2b3fe4a5be2.mta) (4.69 KB)  
DD.20150327.1637.CET

[Test2015\_20150327.LaurenBacall.mta](https://community.mp3tag.de/uploads/default/original/2X/b/b926ed84b2648a9e200c20d3a3a8d2b3fe4a5be2.mta) (4.69 KB)

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 27, 2015, 2:44pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/7 "2015-03-27T14:44:35Z")

</div>

> [@DetlevD](#):
>
> Although you are already satisfied, ...  
> I have attached a Mp3tag action group for your disposal and testing.  
> [Test2015\_20150327.LaurenBacall.mta](https://community.mp3tag.de/uploads/default/original/2X/b/b926ed84b2648a9e200c20d3a3a8d2b3fe4a5be2.mta) (4.69 KB)  
> DD.20150327.1637.CET

Woah... that's some impressive handiwork 😃 Can't understand most of what's happening, it seems to be going through line by line and checking if the line matches those to be kept?

Also neat way of adding code comments 🙂

---

<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:** [March 27, 2015, 3:17pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/8 "2015-03-27T15:17:49Z")

</div>

> [@LaurenBacall](#):
>
> ... Can't understand most of what's happening, it seems to be going through line by line and checking if the line matches those to be kept?

Hmm, this is not a sequential search line by line, ...  
but it looks for key-words in the leading part of the lines in question, ...  
then it fetches the entire line.  
This offers the possibility to arrange the output text as needed.

DD.20150327.1717.CET

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 27, 2015, 3:38pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/9 "2015-03-27T15:38:34Z")

</div>

> [@DetlevD](#):
>
> Hmm, this is not a sequential search line by line, ...  
> but it looks for key-words in the leading part of the lines in question, ...  
> then it fetches the entire line.  
> This offers the possibility to arrange the output text as needed.

Ah, this makes it quite flexible. Will keep the Action saved for future usage.

---

<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:** [March 27, 2015, 8:18pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/10 "2015-03-27T20:18:23Z")

</div>

> [@LaurenBacall](#):
>
> Got it working, yay. ...

Although you are already satisfied, ... here is another proposal ...  
I have attached a Mp3tag action group for your disposal and testing.

[Test2015\_20150327.LaurenBacall.v2.mta](https://community.mp3tag.de/uploads/default/original/2X/7/72180612064de9a27f9590a06e9835041e72a8fa.mta) (2.06 KB)

20150327.LaurenBacall.v2.pdf ( 32.19K ) Number of downloads: 2

[20150327.LaurenBacall.v2.pdf](https://community.mp3tag.de/uploads/default/original/2X/c/c739894cf584de275ba8353b75d21fd438301299.pdf) (32.7 KB)

**There is the tag-field COMMENT, which contains several lines of text. Some lines should be removed, ... but some lines should remain, ... which begin with this text ... 'No Agenda ' 'Executive Producers: ' 'Associate Executive Producers: ' 'Club 707 Member: ' 'Thanks to ' 'Art By: ' 'ShowNotes ' 'Last Modified ' Step 1, Remove leading spaces or trailing spaces or empty lines: $regexp(%COMMENT%,'^ \*|\s\*$',) Step 2, Mark the lines, which begin with the given text strings: $regexp(%COMMENT%,'^(No Agenda[:]+)','\7$1') $regexp(%COMMENT%,'^(Executive Producers[:]+)','\7$1') $regexp(%COMMENT%,'^(Associate Executive Producers[:]+)','\7$1') $regexp(%COMMENT%,'^(Club 707 Member[:]+)','\7$1') $regexp(%COMMENT%,'^(Thanks to[:]+)','\7$1') $regexp(%COMMENT%,'^(Art By[:]+)','\7$1') $regexp(%COMMENT%,'^(ShowNotes[:]+)','\7$1') $regexp(%COMMENT%,'^(Last Modified[:]+)','\7$1') ... or ... $regexp(%COMMENT%,'^((?:No Agenda|Executive Producers|Associate Executive Producers|**

**Club 707 Member|Thanks to|Art By|ShowNotes|Last Modified)[:]+)','\7$1')**

 **Step 3, Remove unmarked lines: $regexp(%COMMENT%,'^(?!\7).\*?$',) ... or ... Step 3, Remove marked lines: $regexp(%COMMENT%,'^(?=\7).\*?$',) Step 4, Remove marker: $regexp(%COMMENT%,'^ \*|\7|\s\*$',) Ready.**

DD.20150327.2222.CET, DD.20150328.1150.CET

[Test2015\_20150327.LaurenBacall.v2.mta](https://community.mp3tag.de/uploads/default/original/2X/7/72180612064de9a27f9590a06e9835041e72a8fa.mta) (2.06 KB)

[20150327.LaurenBacall.v2.pdf](https://community.mp3tag.de/uploads/default/original/2X/c/c739894cf584de275ba8353b75d21fd438301299.pdf) (32.7 KB)

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 28, 2015, 9:15am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/11 "2015-03-28T09:15:20Z")

</div>

> [@DetlevD](#):
>
> Although you are already satisfied, ... here is another proposal ...  
> I have attached a Mp3tag action group for your disposal and testing.

This is beautifully compact and documented, thanks DetlevD!

Is there a way I also could remove marked lines instead of keeping them if I wanted?

> [@DetlevD](#):
>
> Remove unmarked lines:$regexp(%COMMENT%,'^(?!\7).\*?$',)

Thought it would be here that I would edit this, but changes made resulted in errors. Perhaps I need to also change the second step.

---

<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:** [March 28, 2015, 9:23am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/12 "2015-03-28T09:23:50Z")

</div>

> [@LaurenBacall](#):
>
> This is beautifully compact and documented, thanks DetlevD! Is there a way I also could remove marked lines instead of keeping them if I wanted? ...

This should work ...

**Step 3, Remove marked lines: $regexp(%COMMENT%,'^(?=\7).\*?$',) If you apply the character '#' as the marker symbol for removing, ... $regexp(%COMMENT%,'^(?=#).\*?$',)**

DD.20150328.1127.CET

---

<div class="post-metadata">

**Author:** ![LaurenBacall](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@LaurenBacall](https://community.mp3tag.de/u/LaurenBacall)\
**Post date:** [March 28, 2015, 9:34am UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/13 "2015-03-28T09:34:53Z")

</div>

> [@DetlevD](#):
>
> This should work ...
> 
> **Step 3, Remove marked lines: $regexp(%COMMENT%,'^(?=\7).\*?$',) If you apply the character '#' as the marker symbol for removing, ... $regexp(%COMMENT%,'^(?=#).\*?$',)**
> 
> DD.20150328.1127.CET

Yup, does just what I wanted 🙂 This is great, have replaced the rather long Action I was using before with this more streamlined version. I can see this being useful for other podcasts, too.

Thanks again!

---

<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:25pm UTC](https://community.mp3tag.de/t/editing-lengthy-comment-tags-using-action/16755/14 "2026-02-09T12:25:36Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


