![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#7
|
|||
|
|||
|
No le veo problema a la estructura de tu fichero txt.
Código:
var l1,l2,l3,l4 : string;
procedure extrae(cad:string;var t1,t2,t3,t4:string);
var q : integer;
begin
t1:='';t2:='';t3:='';t4:='';
q:=1;
while copy(cad,q,1)<>'|' do
begin
t1:=t1+copy(cad,q,1);
inc(q);
end;
inc(q);
while copy(cad,q,1)<>'|' do
begin
t2:=t2+copy(cad,q,1);
inc(q);
end;
while copy(cad,q,1)<>'|' do
begin
t3:=t3+copy(cad,q,1);
inc(q);
end;
inc(q);
t4:=copy(cad,q,3); // el resto
end;
assignfile(ft,DirectoryEdit1.text+'\Anotacion.txt');
{$I-}
Reset(Ft);
{$I+}
if IOResult <> 0 then
begin
Showmessage('No se encuentra el fichero de anotaciones.');
Exit;
end;
while not eof(ft) do
begin
Readln(ft,lin);
extrae(lin,l1,l2,l3,l4);
Table1.Append;
Table1.Fieldbyname('Codigo').asinteger:=strtoint(l1);
Table1.Fieldbyname('Numero').asstring:=l2;
Table1.Fieldbyname('Nombre').asstring:=l3;
Table1.Fieldbyname('Tipo').asstring:=l4;
Table1.Post;
end;
Closefile(ft);
|
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Llenar menú desde Tabla... | vladimirbp | Varios | 2 | 10-11-2006 18:26:53 |
| Error de Sintaxis al Insertar datos a una tabla desde otra | alastor | SQL | 9 | 28-09-2006 18:27:09 |
| llenar una tabla dbf con un query de mysql | coletaun | Varios | 4 | 03-01-2006 22:04:14 |
| Llenar una tabla con datos de otras dos tablas | jovehe | Tablas planas | 2 | 23-08-2004 17:21:55 |
| Necesito llenar un DBGrid desde una consulta con dbexpresss | vivim82 | Varios | 5 | 05-05-2004 18:31:02 |
|