Код
program Zireael;
uses crt;
var numbers:array[1..10] of integer;
eng_high:array[1..26] of integer;
eng_low: array[1..26] of integer;
rus_1: array[1..47] of integer;
rus_2: array[1..17] of integer;
f:file of char;
otf:text;
tmp:char;
i:byte;
t_str,t2_str:string;
begin
clrscr;
assign(f,'c:\chars.txt');
reset(f);
while not eof(f) do
begin
read(f,tmp);
case tmp of
#48..#57 :inc(numbers[ord(tmp)-47]);
#65..#90 :inc(eng_high[ord(tmp)-64]);
#97..#122 :inc(eng_low[ord(tmp)-96]);
#128..#175 :inc(rus_1[ord(tmp)-127]);
#224..#241 :inc(rus_2[ord(tmp)-223]);
end;
end;
assign(otf,'result.txt');
rewrite(otf);
for i:=1 to 10 do
begin
str(numbers[i],t2_str);
t_str:=chr(i+47)+'='+t2_str;
writeln(otf,t_str);
end;
for i:=1 to 26 do
begin
str(eng_high[i],t2_str);
t_str:=chr(i+64)+'='+t2_str;
writeln(otf,t_str);
end;
for i:=1 to 26 do
begin
str(eng_low[i],t2_str);
t_str:=chr(i+96)+'='+t2_str;
writeln(otf,t_str);
end;
for i:=1 to 47 do
begin
str(rus_1[i],t2_str);
t_str:=chr(i+127)+'='+t2_str;
writeln(otf,t_str);
end;
for i:=1 to 17 do
begin
str(rus_2[i],t2_str);
t_str:=chr(i+223)+'='+t2_str;
writeln(otf,t_str);
end;
close(otf);
end.
что-то вроде этого.. вывод в файл "result.txt"