You can use ALINES() function if file isn't too big (no more than 65,000 records).
LOCAL laDummy[1]
lcFileName = "test.txt"
lnRecCount = ALINES(laDummy, FILETOSTR(lcFileName))
? lnRecCount
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--