Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record count in txt file
Message
 
 
To
05/06/2003 15:55:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00796917
Message ID:
00796921
Views:
15
You can use ALINES() function if file isn't too big (no more than 65,000 records).
* ALINES()
LOCAL laDummy[1]
lcFileName = "test.txt"
lnRecCount = ALINES(laDummy, FILETOSTR(lcFileName))
? lnRecCount

* or LLFF
lnFH = FOPEN(lcFileName)
lnRecCount = 1
=FGETS(lnFH, 8192)
DO WHILE NOT FEOF(lnFH)
	lnRecCount = lnRecCount + 1
	=FGETS(lnFH, 8192)
ENDDO
=FCLOSE(lnFH)	
? lnRecCount
>Hey Everyone,
>I am trying to get a record count of a txt file without any luck. Does anyone know how to do this? I think I have to use the FGETS() function and count the carriage returns but am not sure how to do this. Any help would be appreciate. Thanks.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform