Ver Mensaje Individual
  #3  
Antiguo 24-06-2011
rxaxx9 rxaxx9 is offline
Registrado
 
Registrado: jun 2008
Posts: 8
Reputación: 0
rxaxx9 Va por buen camino
Cita:
Empezado por ecfisa Ver Mensaje
Hola.

Código Delphi [-]
procedure PasarAMemos(NomArch: string; M1,M2,M3: TMemo);
var
  F: TextFile;
  TS: TStrings;
  s: string;
begin
  AssignFile(F, NomArch);
  try
    Reset(F);
    ReadLn(F);// desactivá esta linea para que muestre MEMO1,MEMO2 y MEMO3
    try
      TS:= TStringList.Create;
      TS.Delimiter:= ' ';
      while not Eof(F) do
      begin
        ReadLn(F,s);
        TS.DelimitedText:= s;
        M1.Lines.Add(TS[0]);
        M2.Lines.Add(TS[1]);
        M3.Lines.Add(TS[2]);
      end;
    finally
      TS.Free;
    end;
  finally
    CloseFile(F);
  end;
end;

Ejemplo de llamada:
Código Delphi [-]
...
  Memo1.Clear;
  Memo2.Clear;
  Memo3.Clear;
  PasarAMemos('C:\TU_ARCHIVO.TXT', Memo1,Memo2,Memo3);
...

Saludos.
Gracias. me funciono 100%.

les hice unas pequeñas modificaciones
Código Delphi [-]
Procedure Limitaciones(Const RUTA: string; M1,M2,M3: Tmemo);
var
Cargar: TstringList;
x: Integer;
begin
cargar := tstringlist.Create;
cargar.LoadFromFile(ruta);
cargar.Delimiter := ';';
cargar.DelimitedText := CARGAR.Text;
for x:= 0 to CARGAR.Count -1 do
Begin
TRY
m1.Lines.Add(CARGAR[X]);
CARGAR.Delete(x);
m2.Lines.Add(CARGAR[X]);
CARGAR.Delete(x);
m3.Lines.Add(CARGAR[X]);
except
end;
end;
end;

pd: esta ves no es un espacio el delimitador ahora es un ";"
Responder Con Cita