Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import text file - more than 256 fields
Message
De
28/03/2004 22:33:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00890295
Message ID:
00890320
Vues:
21
Thanks. I don't see any way to edit posts. Here's the code again, hopefully formatted this time:
DO WHILE .T.
    DataString = FGETS(nCDataHandle,5000)
    SELECT FD
    m.Start = 1
    SCAN
        m.FieldNum = FD.Field_Name
        FieldData = SUBSTR(DataString,m.Start,FD.Field_Len)
        FieldNum = IIF(FD.Field_Type = 'N',VAL(m.FieldData),m.FieldData)
        m.Start = m.Start + FD.Field_Len
    ENDSCAN

    INSERT INTO (OutputName) FROM MEMVAR

    IF FEOF(nCDataHandle)
        EXIT
    ENDIF
ENDDO
FD is a table that contains the field definitions for the input file. It is used to create the table that will contain the data (using the CREATE FROM command) and is also used to parse the text.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform