procedure reformat(st_name,st_name2:string);
var setfile,config:text;
var s,stx:string;
    x,a,s1,s2:integer;
    c1,c2,c3,c4,c5:char;
    set1,set2:set of char;
begin
  c1:=chr(34);
  c2:=chr(39);
  set1:=['a'..'z','A'..'Z','0'..'9','_','-','.'];
  set2:=[' ',':',c1,c2];
  assign(setfile,st_name2);
  rewrite(setfile);
  assign(config,st_name);
  reset(config);
  x:=0;
  while not(eof(config)) do begin
    x:=x+1;
    readln(config,s);
    s:=cutlr(s);
    while pos('@',s)>0 do begin
      a:=pos('@',s);
      while a>0 do begin
	dec(a);
	if s[a] in set1 then
	  s1:=a
	else begin s1:=a+1; a:=0; end;
      end;
      s:=copy(s,s1,255);
      a:=pos('@',s);
      while a<256 do begin
	inc(a);
	if s[a] in set1 then
	  s1:=a
	else begin s1:=a-1; a:=256; end;
      end;
      if epos('@',s,s1)=0 then begin
	stx:=copy(s,1,s1);
	writeln(setfile,stx);
	s:=copy(s,s1+1,255);
      end else begin
	writeln(setfile,copy(s,1,s1));
	s:='';
      end;
    end; {while linea}
    
  end; {while file}

  close(config);
  close(setfile);
  message2('finito',1,1);
end;