Ver Mensaje Individual
  #4  
Antiguo 24-10-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var Input, Output: TextFile; Line: string;
begin
 AssignFile(Input, Edit1.Text);
 {$i-}Reset(Input);{$i+}
 if IoResult <> 0 then Exit;
 AssignFile(Output, Edit1.Text + 'o');
 ReWrite(Output);
 while not EOF(Input) do
  begin
   ReadLn(Input, Line);
   while (Line <> '') and (Line[1] = ' ') do
    Delete(Line, 1, 1);
   if (Line <> '') and
      (((Line[3] in ['0'..'9']) and (Line[11] = ' ')) or
       ((Copy(Line, 1, 9) = 'OFICINA: ') or (Copy(Line, 1, 9) = 'SINIESTRO'))) then
    WriteLn(Output, Line);
  end;
 CloseFile(Output);
 CloseFile(Input);
end;

Me tome la libertad de optimizarlo un poquito ; creo que tu función no tomaba en cuenta la última línea.

Espero te sea de utilidad.
Saludos
Responder Con Cita