Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading TEXT file.
Message
From
17/03/1999 10:30:51
Donny Sims
Independent Computer Consultants Inc
Scottsboro, Alabama, United States
 
 
To
17/03/1999 00:17:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00198445
Message ID:
00198569
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform