Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading TEXT file.
Message
De
17/03/1999 10:30:51
Donny Sims
Independent Computer Consultants Inc
Scottsboro, Alabama, États-Unis
 
 
À
17/03/1999 00:17:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00198445
Message ID:
00198569
Vues:
18
>Dears,
>
>I am trying to manipulate a very large text file with VFP, my way is by creating a temporary single table and appending that text file into it.
>
>is there any other way or maybe any specific command within VFP to read the text file without appending it into a table.
>
>
>Tia,
>Andreas.

Andreas

If you don't have VFP 6, the following will read the file into a string varable.
LOCAL wholefile, handle, fileeof, filebof
STORE FOPEN('c:\yourfile.txt') TO handle    && Open the file
STORE FSEEK(handle, 0, 2) TO fileeof 	    && Move pointer to EOF
STORE FSEEK(handle, 0) TO filebof           && Move pointer to BOF
IF fileeof <= 1                             && Is file empty?
	WAIT WINDOW 'This file is empty!' NOWAIT
	wholefile = ' '
ELSE  && If not empty
	wholefile = FREAD(handle, fileeof)  && Store to memory
ENDIF
= FCLOSE(handle)                            && Close the file
HTH
Donny Sims

Life is what happens to us while were busy making other plans.
- John Lennon
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform