소프트웨어 관련/소프트웨어 이야기

Mp3tag 실행 스크립트 - ID3 아티스트명의 일부분을 제목으로 이동

동해랑 2011. 7. 20. 21:17
Artist: GG Feat. 박봄
Title: 바람났어

to

Artist: GG
Title: 바람났어 (Feat. 박봄)

Action: Guess Values
Source Format: %title% $regexp(%artist%,(.*) Feat. (.*),'('Feat. $2')' +++ $1)
Guessing Pattern: %title% +++ %artist%





Artist: Rihanna Feat. Eminem
Title: Love The Way You Lie (Part II)

to

Artist: Rihanna
Title: Love The Way You Lie (Part II Feat. Eminem)

Action: Guess Values
Source Format: $replace(%title% $regexp(%artist%,(.*) Feat. (.*),'('Feat. $2')' +++ $1),') (', )
Guessing Pattern: %title% +++ %artist%





Artist: Abel Ramos feat Rozalla
Title: Where Is The Love (Antoine Clamaran Remix)

to

Artist: Abel Ramos
Title: Where Is The Love feat Rozalla (Antoine Clamaran Remix)


Action: Guess Values
Sourceformat: $regexp(%artist%,(.*) feat (.*),$1,1) - $regexp(%title%,(.*) \((.*)\),$1,1)$mid(%artist%,$strstr($lower(%artist%), feat),999)$mid(%title%,$strstr(%title%,' ('),999)
Guessing Pattern: %artist% - %title%


The result of the sourceformat string must be "Abel Ramos - Where Is The Love feat Rozalla (Antoine Clamaran Remix)", what coresponds to the Guessing Pattern "%artist% - %title%"
The sourceformat has four parts:

%artist% = Abel Ramos feat Rozalla
string result = Abel Ramos
$regexp(%artist%,(.*) feat (.*),$1,1)
(the 1 at the end of the string is for ingonring cases -> Feat = feat)


%title% = Where Is The Love (Antoine Clamaran Remix)
string result = Where Is The Love
$regexp(%title%,(.*) \((.*)\),$1,1)
(the 1 at the end of the string is for ingonring cases, would not be necessary here)


%artist% = Abel Ramos feat Rozalla
string result = feat Rozalla
$mid(%artist%,$strstr($lower(%artist%), feat),999)


%title% = Where Is The Love (Antoine Clamaran Remix)
string result = (Antoine Clamaran Remix)
$mid(%title%,$strstr(%title%,' ('),999)


$mid(x,i,999) is nonsense. it is the same as $cutleft(x,i)
Seems as i was thinking in twisted ways. I added 999 to have a position which is after the end, to make sure nothing is cutted away at the end.



* 출처: http://forums.mp3tag.de/index.php?showtopic=12513&st=0