function GetCharCnt(CntStr:String;SrcFile:String):Integer;
//CntStr:need cout str
//SrcFile:file to count
var
f:TextFile;
s:string;
cPos:integer;
begin
result := 0;
assignfile(f,SrcFile); //open file
reset(f);
while not eof(f) do //if not end of file
begin
readln(f,s); //read one line from file
cPos := pos(CntStr,s); //try to get one cont
while cPos > 0 do //get it
begin
inc(result); //add one
delete(s,1,cPos); //delete count str
cPos := pos(CntStr,s); //count it again
end;
end;
closefile(f); //close file
end;