Filters and actions


#1

I am in the process of a major overhaul of my karaoke collection. In the early days I was not as careful with my tagging as I should have been, I am about to use a Karaoke player that relies on filenames, so I need to get all my tags uniform so that the tag to filename option will give me consistent filenames.
The album tag must only have one hypen – SunFly001-01. some of mine have two – SunFly-001-01 or even SunFly – 001 – 01.
It would be good if I could execute a filter to find all album tags with 2 or more hyphens and then perform an action that would remove the first or second hyphen.

My next problem involves Ozzy Osbourne etc etc. Some entries are Ozzy Osbourn (no e). if I perform an action –change ‘Ozzy Osbourn’ to ‘Ozzy Osbourne’ then if the entry was already ‘Ozzy Osbourne’ I get ‘Ozzy Osbournee’ (2e). (just changing 'Osbourn' is not an option.)
Also if I want to change an entry that is just ‘Ozzy’ to ‘Ozzy Osbourne’ if the entry is already ‘Ozzy Osbourne’ I get ‘Ozzy Osbourne Osbourne’.

I am sure there is a simple solution, there always is, but I just cannot see it.

Regards


#2

You can filter for two hyphens using -.*- as filter criteria.


#3

OK, that works - you knew it would.

Having filtered the ones I need, how can I delete the first instance or perhaps second instance of the hyphen.

regards and thanks


#4

After looking into http://www.unicode.org/charts/PDF/U2000.pdf you will see, that there exist different punctuation symbols named 'dashes'. e. g. the minus or hyphen sign '-' and the figure dash '–'.
Your filenames use both characters in a free style mixed up way, e. g. 'SunFly-001-01' or even 'SunFly – 001 – 01'.
Looking at your filenames it might be true, that, if a figure dash is used, then the figure dash has the meaning of a delimiter, and on the other hand, if a hyphen is used, then the hyphen has the meaning of a connector.

In order to get rid of the first or second dash, provided that the dashes do not have any special meaning, you should make all dashes the same type by a $replace() function, e.g.
$replace('SunFly – 001 – 01',' – ','-').

Afterwards you can use a $regexp() function to remove the dashes you want. e. g.
$regexp('SunFly-001-01',(.?)-(.),$1$2) removes the first dash, giving 'SunFly001-01'.
$regexp('SunFly-001-01',(.)-(.),$1$2) removes the last dash, giving 'SunFly-00101'.
$regexp('SunFly-00-1-01',(.?-.?)-(.*),$1$2) removes the second dash, giving 'SunFly-001-01'.

DD.20080325.1757.CET


#5

Thanks, as always, for your help.

Can make all the hyphens the same – say hyphen with no space to the left or right.

Because I am doing a global change, say up to 3000 tracks at a time I will not know what comes before of after the “hyphen” I only know that I want to delete the first or second “hyphen”.

Thanks again.