Create action (s) to delete and insert text

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 :slight_smile:

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

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

1 Like

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

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:

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: :