Parshing script using input from a file to another

Hi all
As quite newbie in shell scripting i need your help.
The case: two files with question mark delimeter:
file1.txt:
A; B; D; E;

file2.txt:
a,antonis,red; b,maria,green; c,george,blue; d,jack,red; e,Helen,yellow; k,konstantin,black;

I need an effiecient way of parsing while it will read the file1.txt as input to the file2.txt and produce a file3.txt with the following results, in order to be able also to count the lines of the results:

file3.txt:
a,antonis,red;
b,maria,green;
d,jack,red;
e,Helen,yellow;

I was thinking some "for loop" but since file1.txt will be from hundren to some thousand of entries and file2.txt is almost a million lines to look into, this serial way will take ages (if the server will not crushed eventually :D).
Any help is more than welcome. I am working on Solaris 9 or 10 if that helps.
BR
CJ

is this homework? please read our rules before posting!

Unfortunatelly I am to old for school and there is almost a year since my last script.
i kow that i have to use awk and probably sed with substr defining the delimeter, but all the post I checked are talking either for fixed number of lines using AWK NF or fixed lenght of string.

Trully sorry for the inconvience...