Help - Search - Members - Calendar
Full Version: Adding text to field if not already present
Mp3tag Forums > Mp3tag - International > Support
ExitRitual
Hi All,

Apologies if this has been covered, but i couldn't find anything. I've also looked at the FAQ but code is FAR from my strong-point.

I'm looking to add ' OST' (that's; _space_OST) to the end of all ARTIST field if not already present. I'd like it to be case sensitive and exact phrase match, too.

If anyone can help me out on this, i'd really appreciate it.
DetlevD
QUOTE (ExitRitual @ May 4 2012, 18:25) *
... Apologies if this has been covered, but i couldn't find anything. I've also looked at the FAQ but code is FAR from my strong-point.
I'm looking to add ' OST' (that's; _space_OST) to the end of all ARTIST field if not already present. I'd like it to be case sensitive and exact phrase match, too. If anyone can help me out on this, i'd really appreciate it.

1. Appending something to a tag-field is standard theme of the FAQ area.

2. Appending something in the case of while it does not already exist, this is a matter of checking out, whether some value exists or not.
For your example this might be 'very easy'.

Look at the rightmost four characters ... $right(%ARTIST%,4).
Check the value against the given tag-field content ... $eql($right(%ARTIST%,4),' OST')
Make a decision what to do ... $if($eql($right(%ARTIST%,4),' OST'),%ARTIST%,%ARTIST%' OST')

DD.20120504.1850.CEST
ExitRitual
QUOTE (DetlevD @ May 4 2012, 17:58) *
$if($eql($right(%ARTIST%,4),' OST'),%ARTIST%,%ARTIST%' OST')



Thanks very much smile.gif
Worked perfectly.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.