#11 2021-06-09 14:22

Lauraq
Member
Registered: 2016-10-02
Posts: 38

Re: Change case of name differently for Author, Title and comment part

thanks...but for now, there is a simple solution only for my single example?

11 - Simone filippi & Luca alfonso rossi - Cuore spezzato (Feat Carl brave)

Can I have

11 - Simone Filippi & Luca Alfonso Rossi - Cuore spezzato (feat Carl Brave)

smile

Last edited by Lauraq (2021-06-09 14:22)

Offline

#12 2021-06-21 12:06

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 340

Re: Change case of name differently for Author, Title and comment part

Add this Pascal script rule:

var
  Parts: TStringsArray;

begin
  Parts := SubMatchesRegEx(WideExtractBaseName(FileName), '(.+ - )([a-zA-Z]+) ([a-zA-Z ]+)*(\(feat[^)]+\))', false);
  If (Length(Parts) <=0) then exit;

  FileName := Parts[0] + Parts[1] + ' ' + WideLowerCase(Parts[2]) + Parts[3] + WideExtractFileExt(FileName);
end.

So complete ruleset should be:

1) Case: Capitalize every word (skip extension), Force case fragments "feat"
2) Pascal Script: var Parts: TStringsArray; begin Parts := SubMatchesRegEx(WideExtractBaseName(FileName), '(.+ - )([a-zA-Z]+) ([a-zA-Z ]+)*(\(feat[^)]+\))', false); If (Length(Parts) <=0) then exit; FileName := Parts[0] + Parts[1] + ' ' + WideLowerCase(Parts[2]) + Parts[3] + WideExtractFileExt(FileName); end.

It seems that now works for all examples without freeze smile


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#13 2021-06-21 17:58

Lauraq
Member
Registered: 2016-10-02
Posts: 38

Re: Change case of name differently for Author, Title and comment part

incredible, I don't know this Pascal but he must have been a genius big_smile

Thank you so much, you have been very kind and I guess it took you a long time to solve my problem, thanks again! smile

Offline

#14 2021-06-22 15:10

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 340

Re: Change case of name differently for Author, Title and comment part

You're welcome. RegEx expression added in Pascal rule is a bit different than one in RegEx rule. It is faster but since there is an issue with case conversion in Replace text box, it can't be added in the RegEx rule to get desired output. Pascal rule solved that problem smile

I hope that we will get soon "Case - Advanced" rule to work with these kinds of requests with more ease.


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#15 2021-06-22 16:52

Lauraq
Member
Registered: 2016-10-02
Posts: 38

Re: Change case of name differently for Author, Title and comment part

I'll pretend I understand everything big_smile

Offline

Board footer

Powered by FluxBB