I'm trying to make a subroutine to put inside scripts that does this:
from a title like this:
Il.Colore.viola.[XviD-ITA-ENG].avi
changes dots into spaces and removes square brackets with all written inside, having a result like this:
Il Colore viola
Is anyone able to write the/a valid code?
Thank YOU all
ABN
[REL] Subroutine: The.Mission.[DVD] to The Mission
[REL] Subroutine: The.Mission.[DVD] to The Mission
Last edited by ABNormal on 2005-03-07 14:14:38, edited 2 times in total.
As I said somewhere else, simply use the functions of StringUtils1:
Code: Select all
program NewScript;
uses
StringUtils1;
var
s, s2: string;
begin
s := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
s2 := TextBefore(s, '[', '');
if s2 = '' then
s2 := s;
SetField(fieldOriginalTitle, s);
end.
now i have studied this script.
now i'm changing the MovieName definition (into scripts i use) as:
(adding
at the beginning of each script, of course)
solving my little "problem"
i thank you for all your precious helps.
ABN
now i'm changing the MovieName definition (into scripts i use) as:
Code: Select all
MovieName := StringReplace(GetField(fieldTranslatedTitle), '.', ' ');
if MovieName = '' then
MovieName := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
While pos ('[', MovieName) > 0 Do begin
MovieName := TextBefore(MovieName, '[', '') + TextAfter(MovieName, ']');
end;
Code: Select all
uses
StringUtils1;
solving my little "problem"
i thank you for all your precious helps.
ABN