Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record count in txt file
Message
 
 
À
05/06/2003 15:55:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00796917
Message ID:
00796921
Vues:
14
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform