Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import text.file
Message
 
À
20/07/2004 04:56:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00926025
Message ID:
00926027
Vues:
17
Mohammed do something like that:
CREATE CURSOR cImprt (Fld1 C(10), fld2 C(10), fld3 C(10), fld4 C(10), fld5 C(10))

cParseChar = CHR(13)+CHR(10)
my_txt = FILETOSTR("MyTextFile")

all_lines = ALINES(txtLines, my_txt, cParseChar)
SELECT cImprt
currentField = 0
FOR i = 1 TO all_lines
    currentField = currentField + 1
    IF currentField > 5
       currentField = 1
    ENDIF
    IF currentField == 1
       INSERT INTO cImprt (Fld1) VALUES (txtLines[i])
    ELSE
       fldname = FIELD(i, "cImprt")
       REPLACE &fldname WITH txtLines[i]
    ENDIF
ENDFOR
(never tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform