Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import text.file
Message
De
20/07/2004 08:47:13
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
20/07/2004 04:56:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00926025
Message ID:
00926058
Vues:
25
Hi Mohammed

>i want to import a text file,with one field,
>i want to divide this field to 5 or 6 fields,

Yourfile.txt
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
Import.prg
CREATE CURSOR c_Temp (cImport c(50), cField1 c(10), cField2 c(10), cField3 c(10), cField4 c(10), cField5 c(10))
APPEND FROM yourfile.txt TYPE sdf
REPLACE ALL ;
  cField1 WITH SUBSTR(cImport,1,10), ;
  cField2 WITH SUBSTR(cImport,11,10), ;
  cField3 WITH SUBSTR(cImport,21,10), ;
  cField4 WITH SUBSTR(cImport,31,10), ;
  cField5 WITH SUBSTR(cImport,41,10) ;
  IN c_Temp
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform