IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

 
Reply to this topicStart new topic
> Adding text to field if not already present
ExitRitual
post May 4 2012, 17:25
Post #1


Member


Group: Full Members
Posts: 20
Joined: 12-January 10
Member No.: 11649
Mp3tag Version: 2.45



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.
Go to the top of the page
 
+Quote Post
DetlevD
post May 4 2012, 17:58
Post #2


Member


Group: Full Members
Posts: 4787
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.61d



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


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
ExitRitual
post May 5 2012, 12:53
Post #3


Member


Group: Full Members
Posts: 20
Joined: 12-January 10
Member No.: 11649
Mp3tag Version: 2.45



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



Thanks very much smile.gif
Worked perfectly.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd July 2014 - 14:24