#1 2025-01-10 20:56

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

Everything lowercase except (feat... )

Hi smile

I have a lot of songs that are like this:

14 - Senza Una Donna (Without a woman) (feat jack savoretti)

is it possible to have everything lowercase (except the first letter) but have the content in "(feat " uppercase?
Like this:

14 - Senza una donna (without a woman) (feat Jack Savoretti)

Thanks smile

Offline

#2 2025-01-11 22:12

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,451

Re: Everything lowercase except (feat... )

There is no quick way to apply the Case rule options selectively yet.

However, you can use a combination of these two rules:

1. Case rule: First letter capital.
2. Pascal Script rule: Use the script below.

const
  Delimiter = '(feat ';
var
  Start: Integer;
  BaseName, Extension, Prefix, Suffix: Widestring;
begin
  Extension := WideExtractFileExt(FileName);
  BaseName := WideStripExtension(FileName);
  Start := WideTextPos(Delimiter, BaseName);
  if Start > 0 then
  begin
    Prefix := WideCopy(BaseName, 1, Start - 1);
    Suffix := WideCopy(BaseName, Start + Length(Delimiter), Length(BaseName));
    FileName := Prefix + Delimiter + WideCaseCapitalize(Suffix) + Extension;
  end;
end.

Basically, this script applies capital case to the part of the filename that follows "(feat ".

Offline

#3 Yesterday 09:26

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

Re: Everything lowercase except (feat... )

thank you, you are always so kind
That's exactly what I was looking for smile

Offline

Board footer

Powered by FluxBB