const
 count		= 20;
 name_len       = 11;
 phone_len      = 9;

type TPhoneEntry = record
  Name  : string[name_len];
  Phone : string[phone_len];
end;


var
  DB2	     : array [1..count] of TPhoneEntry;
  INP	     : text;
  Output     : FILE oF TPhoneEntry;
  k          : integer;

begin
  Assign(INP,'phones.txt');
  {$I-}
    Reset(INP);
    If IOResult <> 0 then
     begin
       WriteLn('File ''phones.txt'' not found');
       Halt(255);
     end;
  {$I+}

  for k := 1 to count do
   begin
     Read(INP,DB2[k].Name);
     ReadLn(INP,DB2[k].Phone);
   end;

  Close(INP);

  Assign(Output,'phones.dat');
  Rewrite(Output);
  for k:=1 to count do Write(Output,DB2[k]);
  Close(Output);
end.
