Ver Mensaje Individual
  #4  
Antiguo 30-09-2006
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Reputación: 20
Héctor Randolph Va por buen camino
Te dejo una rutina con la cual puedes leer el archivo, solamente restaría insertar los registros en las tablas correspondientes:

Suponiendo que tu archivo tiene esta forma:

Código:
"uno 1","uno 2","uno 3","uno 4","uno 5"
"dos 1","dos 2","dos 3","dos 4","dos 5"
"tres 1","tres 2","tres 3","tres 4","tres 5"
Puedes leer los datos así:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
 Archivo: TStringList;
 Linea: TStringList;
 Fila, Columna: Integer;
begin
  Archivo:=TStringList.Create;
  Linea:=TStringList.Create;
  Archivo.LoadFromFile('Archivo.txt');

  for Fila:=0 to Archivo.Count-1 do
  begin
   Linea.CommaText:=Archivo[Fila];
   ShowMessageFmt('Registro actual = %d',[Fila]);
   for Columna:=0 to Linea.Count-1 do
    ShowMessageFmt('Contenido del campo %d = %s',[Columna,Linea[Columna]]);
  end;
  Linea.Free;
  Archivo.Free;
end;

Saludos
Responder Con Cita