>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement