I've decided that IMDB's multiple category function is a bit too detailed/OTT for my collection. However, I've used it for years so there's a lot of entries to change!
I see that IMDB's simple/single category function simply takes the first value and ignores all others which is what I'd prefer.
e.g
"Adventure / Biography / Drama / History / War"
simply becomes
"Adventure"
Rather than resorting to the IMDB script to accomplish this and eating bandwidth, are there any scripting functions I could use to truncate the detailed entries I already have?
So, all over values after the first instance of "/" are erased in the category field?
Thanks!
Can a script be used to truncate fields at a certain point?
Hi,
You can use the little script below to keep only the first value in field category.
Run this script on all your movies and it is done
.
Soulsnake.
You can use the little script below to keep only the first value in field category.
Run this script on all your movies and it is done

Code: Select all
program KeepOnlyFirstValueInFieldCategory;
var
s: string;
i: Integer;
begin
s := GetField(fieldCategory);
i := Pos('/', s);
if i = 0 then
i := Pos(',', s);
if i = 0 then
i := Pos(';', s);
if i > 0 then
begin
s := Copy(s, 1, i-1);
s := Trim(s);
SetField(fieldCategory, s);
end;
end.
Last edited by soulsnake on 2013-07-27 12:12:31, edited 1 time in total.