If string - exclude action for some fields based on condition

If I would like to apply an action to a field, is it possible with regex to exclude a specific application in a field - like a conditional if action?

Case 1
Replace "&" with "," but exclude the names of some artists that include "&"
For example in the case of "Merk & Kremont", Dzeko & Torres" etc, don't replace the "&"

Case 2
A similar case - if a field has anywhere the word "edit" rename to " remix", except when the field contains "Radio Edit"

Are any of the above possible?

Thank you

I would filter F3 all tracks including a "&" but not your "some artists".
Select them and do a simple REPLACE.

Same for your Case 2.

Is it possible to incorporate any of the above into an action?

I don't know how well you know your collection - but making
Emerson, Lake & Palmer to Emerson, Lake, Palmer would just not be it.
Same applies to
Bell, Book & Candle
KC & The Sunshine Band
Kid Creole & The Coconuts
Dave Dee, Beaky, Dozy, Mick & Titch
and many more.
So letting an action with a lot of if condition loose on a whole collection would probably lead to suprising, yet unwanted effects.

For the sake of it, perhaps you can assemble something yourself:
To test for the presence of a string, there is the $strstr() function.
For logic comparisons, there are a number of boolean functions, see the help:

I am no friend of complicated expressions that try to deal with exceptions of a pattern - either one cannot remember what they meant esp. if one hasn't developed them oneselt or more exceptions creep up that need a completely different approach but their data gets destroyed with one of these allegedly automatic actions.
The advantage of a filter is that you see which data will be treated.
If you let an action run on more or less all files then you don't see if any transformation has happened, you treat many more files than necessary and you cause perhaps undesirable side effects which slip through the net as you don't see which files got treated and which didn't.

In respect to case 2:
I just found: "Sean Finn X Guru Josh: Infinity 2018 [Klaas Remix Edit]"
According to your rule this would become "Sean Finn X Guru Josh: Infinity 2018 [Klaas Remix Remix]"
(I found this using a filter - this filter showed also, that there are more than 100 further candidates for this modification)

And this brings me to the point why I am writing long texts but do not supply the requested expression:
It will take some time to get it right - and I feal that this time will be wasted as after you have run the action, you fill find so and so many further exceptions which would, if taken care of, most likely require the whole code to be rewritten.
And all this effort where a simple filter would allow to use a much simpler action and to find - also much simpler - some more exceptions.

Thank you for the lengthy explanation.
Your replies are always informative and useful!

A filter to hide these:
%title% HAS & AND NOT %title% MATCHES "&.*&"

1 Like

Thank you for the assistance!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.