Page 1 of 1
Batch Script to replace only actor field based on URL!?!?
Posted: 2003-11-02 11:39:29
by Mikefox
My DVD list is complete (920) but I wan't to replace the actor field with only 10 actors without the caracter they play.
Can somebody make a Batch Script that replaces the existing actor fields based on an URL search for all movies.
Because I have all the URL's from IMDB so it should be faster to get them from the page without a movie search.
I hope somebody can create this!
THX in advance

Posted: 2003-11-02 12:11:22
by antp
No need to fetch that on IMDB since you only want to remove parts of existing info

What does the actor field currently look like ?
Posted: 2003-11-02 12:25:49
by Mikefox
antp wrote:No need to fetch that on IMDB since you only want to remove parts of existing info

What does the actor field currently look like ?
At this moment the actor fields looks like this:
Tommy Lee Jones (as Col. Hayes 'Hodge' Hodges), Samuel L. Jackson (as Col. Terry L. Childers), Guy Pearce (as Maj. Mark Biggs), Ben Kingsley (as Ambassador Mourain), Bruce Greenwood (I) (as National Security Advisor Bill Sokal), Anne Archer (as Mrs. Mourain), Blair Underwood (as Capt. Lee), Philip Baker Hall (as Gen. H. Lawrence Hodges), Dale Dye (as Gen. Perry), Amidou (as Dr. Ahmar), Mark Feuerstein (as Tom Chandler), Richard McGonagle (as Judge Col. E. Warner), Baoan Coleman (as Col. Binh Le Cao), Nicky Katt (as Hayes Hodges III), Ryan Hurst (as Cpl. Hustings)
THX for the quick respond antp

(bedankt!)
Posted: 2003-11-02 13:11:35
by antp
this should work, but make a backup of your catalog before

:
Code: Select all
program NewScript;
var
s: string;
ParCount, ParPos: Integer;
ActCount: Integer;
p: Integer;
begin
ParCount := 0;
ParPos := 0;
s := GetField(fieldActors);
p := 1;
while p <= Length(s) do
begin
if StrGet(s, p) = '(' then
begin
if ParCount = 0 then
ParPos := p;
ParCount := ParCount + 1;
end
else
if StrGet(s, p) = ')' then
begin
ParCount := ParCount - 1;
if ParCount < 1 then
begin
ParCount := 0;
Delete(s, ParPos - 1, p - ParPos + 2);
p := ParPos - 1;
end;
end;
p := p + 1;
end;
ActCount := 0;
p := 1;
while p <= Length(s) do
begin
if StrGet(s, p) = ',' then
begin
ActCount := ActCount + 1;
if ActCount = 10 then
Delete(s, p, Length(s));
end;
p := p + 1;
end;
SetField(fieldActors, s);
end.
Posted: 2003-11-02 13:38:16
by Mikefox
Works brilliantly!!
THX ANTP!!!
