Ver Mensaje Individual
  #2  
Antiguo 10-04-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Reputación: 25
egostar Va camino a la fama
Aqui te dejo una rutina que te hace lo que quieres, lo hice usando dos TMemo, tú modificalo a manera de que leas el archivo de texto y sigue esa lógica.

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
Var
  linea: string;
  corte: string;
  i: integer;
begin
  Linea := Memo1.Lines.Strings[0];
  Corte := copy(linea,3,4);
  for i := 1 to memo1.Lines.Count - 1 do begin
      Linea := Memo1.Lines.Strings[i];
      if corte = copy(linea,3,4) then begin
         Memo2.Lines.Add(Linea);
      end
      else begin
             Memo2.Lines.Add('************************');
             Memo2.Lines.Add(Linea);
             Corte := copy(linea,3,4);
      end;
  end;
end;

Salud OS.
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita