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
-
ABNormal
- Posts: 135
- Joined: 2005-01-08 08:33:38
[REL] Subroutine: The.Mission.[DVD] to The Mission
Last edited by ABNormal on 2005-03-07 14:14:38, edited 2 times in total.
-
antp
- Site Admin
- Posts: 9906
- Joined: 2002-05-30 10:13:07
- Location: Brussels
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.
-
ScorEpioN
- Posts: 264
- Joined: 2004-08-17 11:02:02
-
ABNormal
- Posts: 135
- Joined: 2005-01-08 08:33:38
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