# Create action (s) to delete and insert text

**URL:** https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805
**Category:** Support
**Created:** [May 28, 2018, 2:50pm UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805 "2018-05-28T14:50:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Beluna](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@Beluna](https://community.mp3tag.de/u/Beluna)
#### Post date: [May 28, 2018, 2:50pm UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805/1 "2018-05-28T14:50:51Z")

</div>

trying to create several actions within a group.

I want to delete spaces before an after :

Example 1. Written-By : carole King. Notice there are 2 spaces before and after the :  
example 2. Background vocal : Sarah Vaughan

to read

Written By: Carole King (notice I removed the - and spaces before and after the : (with only one space behind the 🙂

Last, remove everything before Written. Regardless of what is it word, character, etc..

---

<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: [May 28, 2018, 3:02pm UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805/2 "2018-05-28T15:02:08Z")

</div>

To remove any space in front or behind the colon except one:  
Use an action of the type "Format value"  
Format string: $regexp(%fieldname%,\s+:\s+,': ')  
To replace a hyphen  
Action of the type "Replace" for the field  
Search string: -  
Replace string:  
(a blank)

To remove anything in front of "Written":  
Action of the type "Replace with regular expression" for the field,  
Search string: .\*Written  
Replace: Written

---

<div class="post-metadata">

### Author: ![Beluna](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@Beluna](https://community.mp3tag.de/u/Beluna)
#### Post date: [May 28, 2018, 8:58pm UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805/3 "2018-05-28T20:58:39Z")

</div>

I won't prolong the issue  
The $regexp(%fieldname%,\s+:\s+,': ') solution doesn't work. Simply removes everything the entire field.. I'm using it as a stand alone action, to insure no other actions are interfering.  
Sample.  
Programmed By [Drums] : Alex Hill  
Backing Vocals : Force M.D.'s, Lee Peters, Michael Cooper  
Engineer : David Houston  
Producer, Arranged By, Written By :

#2. \*Written using the example above only removes the space anot everything in front.

I did however change the Written-By..  
Any suggestions. If not, thanks

---

<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: [May 29, 2018, 4:52am UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805/4 "2018-05-29T04:52:49Z")

</div>

> [@Beluna](#):
>
> Sample.  
> Programmed By [Drums] : Alex Hill  
> Backing Vocals : Force M.D.'s, Lee Peters, Michael Cooper  
> Engineer : David Houston  
> Producer, Arranged By, Written By :

provided it can be found in "subtitle" gets transformed with  
`$regexp(%subtitle%,\s+:\s+,': ')`

` "Programmed By [Drums] : Alex Hill  
Backing Vocals : Force M.D.'s, Lee Peters, Michael Cooper  
Engineer : David Houston  
Producer, Arranged By, Written By :"  
-\>

"Programmed By [Drums]: Alex Hill  
Backing Vocals: Force M.D.'s, Lee Peters, Michael Cooper  
Engineer: David Houston  
Producer, Arranged By, Written By :"`  
The last : is left out as there is nothing following - exactly as intended by the regular expression.  
So please check your implementation.  
The same applies to your complaints about #2(? Wasn't replacing the hyphen #2?)

So  
"Programmed By [Drums] : Alex Hill  
Backing Vocals : Force M.D.'s, Lee Peters, Michael Cooper  
Engineer : David Houston  
Producer, Arranged By, Written By :"  
becomes  
"Written By :"

.... adn didn't you get some similar advice years ago:

> [@How to remove white space](https://community.mp3tag.de/t/how-to-remove-white-space/17504/4):
>
> I'm missing something. first let me state this change goes under the field Performers So using your syntax how would i write the text(also, the words should be Capped Field: Performers Original Replace To look like so: Marcus Miller : Bass, Keyboard Thanks

If all that with the regular expression is too error-prone then try two simple replaces to get rid of the extra space around the colon:  
First action of the type "replace"  
Search: `<double blank>`  
Replace: `<single blank>`  
(where the term in \<\> means the space key)  
Second action of the type "Replace"  
Search: `<single blank>:`  
Replace: `:`

---

<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:27pm UTC](https://community.mp3tag.de/t/create-action-s-to-delete-and-insert-text/41805/5 "2026-02-09T12:27:27Z")

</div>


