Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading text file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00063889
Message ID:
00064022
Vues:
45
>>What's the best way to read a text file and save it to table? I want to parse a text file and maybe if i can only use a SUBSTR() function of VSF and save it to table but I know I can't do that. Thankx
>
>Richard,
>
>If the format of the text file is simple enough, you can use the APPEND FROM command. Use the TYPE SDF clause of the APPEND command if the file contains fixed-length un-delimited records and the DELIMITED WITH clause if the fields are delimited.
>
>If the text file requires more sophisticated parsing, you can use low-level file functions. These include FOPEN(), FGETS(), FREAD() and FCLOSE(). Check out the documentation for these functions.
Good Advice. One thing to be careful about if using SDF is to make sure that the target DBF file field lengths are all character and of the exact same length as the source SDF formatted *.txt file. After data import, you can the MODI STRUCT the dbf to suit your future needs. HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform