program t;
const vers:  string[12] = 'Version 1.2 ';
      dat:   string[8] = '26.05.85';
const nul:   char = #0;
      tab:   char = #9;
      lf:    char = #10;
      cr:    char = #13;
      ctrlr: char = #18;
      ctrlt: char = #20;
      esc:   char = #27;
      blank: char = #32;

const rlgth: integer = 80;   { feste Record-Laenge }
var ch: char;
    zeile: string[255];
    datei: text;
    rcnt: integer;           { Record-Zaehler }
    lg,i: integer;
    rl:   integer;
    name: string[12];

begin    { xfer }
ClrScr;
writeln('xfer - ',vers,' vom ',dat); writeln;
write('Dateiname = '); readln(name);
assign(datei,name);
{$I-} reset(datei) {$I+};
if IOresult<>0 then writeln('Datei ',name,' nicht gefunden.')
else
  begin
  rcnt:=0;
  repeat
    begin
    readln(datei,zeile);      { naechste Zeile uebertragen }
    lg:=length(zeile);
    rcnt:=rcnt+1;
    writeln(cr,rcnt,'. Record, Laenge ',lg);
    rl:=0;
    for i:=1 to lg do
      begin
      ch:=copy(zeile,i,1);
      if ch in [' '..'~'] then write(ch)
      else write('.');
      end;
    for i:=lg+1 to rlgth do
      write('_');
    end
  until eof(datei);
  close(datei);
  writeln;
  write('Datei ',name);
  writeln(' gesendet.');
  end;

writeln; writeln('xfer - Ende');
end.

