Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 14-06-2006
Yosuun Yosuun is offline
Miembro
 
Registrado: jun 2004
Ubicación: Bilbao-Bizkaia
Posts: 28
Poder: 0
Yosuun Va por buen camino
Hola yo lo hago de la siguiente manera te pongo el codigo e quitado partes que no son relevantes espero no haber metido la pata y no haber quitado algo importante.

Código Delphi [-]
 
Procedure TWPrograma.TratarFicheroTexto;
Var
  SecFile:TextFile;
  Pf,Pi,Nc:Integer;
  Linea:String;
  Contador:Integer;
  NombreFichero:String;
  C1,C2,C3,C4,C5,C6,C7,C8,C9:String;
  Campo:String;
  PosLp:Integer;
Begin
  AssignFile(SecFile,IFile.FileName);
  Reset(SecFile);
  While not Eof(SecFile) Do
     Begin
       ReadLn(SecFile,Linea);
       Nc:=1;Pi:=1;Campo:='';
       C1:='';C2:='';C3:='';C4:='';C5:='';C6:='';C7:='';C8:='';C9:='';
       while  Pos(',', Linea) > 0 do
          Begin
            IF Pos(',',Linea)>0 Then Pf:=Pos(',',Linea)
            If Nc=1 Then C1:=Copy(Linea,1,Pf-1);
            If Nc=2 Then C2:=Copy(Linea,1,Pf-1);
            If Nc=3 Then C3:=Copy(Linea,1,Pf-1);
            If Nc=4 Then C4:=Copy(Linea,1,Pf-1);
            If Nc=5 Then C5:=Copy(Linea,1,Pf-1);
            If Nc=6 Then C6:=Copy(Linea,1,Pf-1);
            If Nc=7 Then C7:=Copy(Linea,1,Pf-1);
            if Nc=8 then C8:=Copy(Linea,1,Pf-1);
            Linea:=Copy(LInea,Pf,Length(Linea));
            Linea:=Trim(Linea);
            Inc(Nc);
          End;
       C7:=Linea;
       LC1.Caption:=C1;
       LC2.Caption:=C2;
       LC3.Caption:=C3;
       LC4.Caption:=C4;
       LC5.Caption:=C5;
       LC6.Caption:=C6;
       LC7.Caption:=C7;
     End;
  CloseFile(SecFile);
End;


Espero que te sea util.
Un Saludo.

Última edición por roman fecha: 14-06-2006 a las 19:00:45.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Leer un fichero csv con campos separados por puntos y comas. pablo73 Varios 5 19-03-2020 09:47:51
Importar datos a access desde un archivo delimitado por comas luis juarez Conexión con bases de datos 1 10-05-2006 22:46:13
problemas al leer archivo pdf smendo PHP 0 21-07-2005 10:38:33
leer de un archivo javikanin Varios 3 23-11-2004 20:34:32
Importar un archivo separado por comas mivaler Tablas planas 7 20-05-2003 18:48:52


La franja horaria es GMT +2. Ahora son las 16:09:40.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi