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
> Add brackets around featured artists
a10818264@nepwk....
post Jul 5 2012, 13:23
Post #1


Member


Group: Full Members
Posts: 9
Joined: 10-November 11
Member No.: 15562
Mp3tag Version: 2.51



I would like to transform:
"Example Song feat. Someone"
into
"Example Song (feat. Someone)"

I already Googled it and used this code, but replaced "ARTIST" with "TITLE" (and, for aesthetic reasons, "Feat." with "feat.").

The only problem was that it put ')' after any song, not just those songs that had featured artists. I obviously could select only the songs that I need to transform, but I figured some of you might've seen this problem before and already have a solution for this.

Anyhow, hope you guys have the answer. smile.gif

This post has been edited by a10818264@nepwk.com: Jul 5 2012, 22:32
Go to the top of the page
 
+Quote Post
ohrenkino
post Jul 5 2012, 17:20
Post #2


Member


Group: Full Members
Posts: 4382
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.61d



ZITAT(a10818264@nepwk.com @ Jul 5 2012, 14:23) *
... Anyhow, hope you guys have the answer. smile.gif

Yes, as it says in one of mentioned posts: use a filter.


--------------------
42 - wie war die Frage / what was the question / comment était la question
Go to the top of the page
 
+Quote Post
DetlevD
post Jul 5 2012, 18:20
Post #3


Member


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



QUOTE (a10818264@nepwk.com @ Jul 5 2012, 14:23) *
...
I already Googled it ...

Caution: This link is misleading. It does not link to Google.

DD.20120705.1920.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
a10818264@nepwk....
post Jul 5 2012, 22:42
Post #4


Member


Group: Full Members
Posts: 9
Joined: 10-November 11
Member No.: 15562
Mp3tag Version: 2.51



QUOTE (DetlevD @ Jul 5 2012, 23:50) *
Caution: This link is misleading. It does not link to Google.

DD.20120705.1920.CEST


It does now. (Even so: it still linked to Google, you just need to wait.)

Well, guess I'll have to use a filter.

Thanks. smile.gif
Go to the top of the page
 
+Quote Post
stevehero
post Jul 6 2012, 02:45
Post #5


Member


Group: Full Members
Posts: 564
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.59a



QUOTE (a10818264@nepwk.com @ Jul 5 2012, 13:23) *
I would like to transform:
"Example Song feat. Someone"
into
"Example Song (feat. Someone)"

First use a filter like:
"
TITLE" HAS "feat."

Then create an action:
Begin Action Group _Script Test#TEST

Action #1
Actiontype 5: Format value
Field ______: TITLE
Formatstring: $regexp(%TITLE%,'(.+)[^\(]((?=feat\.).+)','$1 ($2)')

End Action Group _Script Test#TEST (1 Action)

Examples of results:
FROM >>> TO
Example Song feat. Someone >>> Example Song (feat. Someone)
fgdgf feat. fsdfsdfl;jyigihkhiutt8y9o >>> fgdgf (feat. fsdfsdfl;jyigihkhiutt8y9o)
Example Song (feat. Someone) >>> Example Song (feat. Someone)
Example Song feat Someone >>> Example Song feat Someone **Doesn't match 'feat'
Example Song Someone >>> Example Song Someone
Example Song (Someone) >>> Example Song (Someone)

This post has been edited by stevehero: Jul 6 2012, 02:46


--------------------
▶✚♬ ═‎​ ♡
Go to the top of the page
 
+Quote Post
a10818264@nepwk....
post Jul 6 2012, 15:09
Post #6


Member


Group: Full Members
Posts: 9
Joined: 10-November 11
Member No.: 15562
Mp3tag Version: 2.51



QUOTE (stevehero @ Jul 6 2012, 08:15) *
First use a filter like:
"
TITLE" HAS "feat."

Then create an action:
Begin Action Group _Script Test#TEST

Action #1
Actiontype 5: Format value
Field ______: TITLE
Formatstring: $regexp(%TITLE%,'(.+)[^\(]((?=feat\.).+)','$1 ($2)')

End Action Group _Script Test#TEST (1 Action)

Examples of results:
FROM >>> TO
Example Song feat. Someone >>> Example Song (feat. Someone)
fgdgf feat. fsdfsdfl;jyigihkhiutt8y9o >>> fgdgf (feat. fsdfsdfl;jyigihkhiutt8y9o)
Example Song (feat. Someone) >>> Example Song (feat. Someone)
Example Song feat Someone >>> Example Song feat Someone **Doesn't match 'feat'
Example Song Someone >>> Example Song Someone
Example Song (Someone) >>> Example Song (Someone)


This works splendidly!
(It really isn't even necessary to run a filter: all the other songs remain unchanged.)

This post has been edited by a10818264@nepwk.com: Jul 6 2012, 15:14
Go to the top of the page
 
+Quote Post
stevehero
post Jul 6 2012, 15:19
Post #7


Member


Group: Full Members
Posts: 564
Joined: 3-December 10
From: Ireland
Member No.: 13334
Mp3tag Version: 2.59a



QUOTE (a10818264@nepwk.com @ Jul 6 2012, 15:09) *
This works splendidly!
(It really isn't even necessary to run a filter: all the other songs remain unchanged.)


yes it searches for anything but '(' and then has a positive lookahead for 'feat.' and unless it finds them then its doesn't match and therefore replace unwanted files.

PS. The filter is handy when you have say 10,000 files and running actions on unwanted files is a waste

EDIT: (screen-shot of how the regexp works)
Attached Image


This post has been edited by stevehero: Jul 6 2012, 15:21


--------------------
▶✚♬ ═‎​ ♡
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: 25th July 2014 - 07:44