Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record count in txt file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00796917
Message ID:
00796976
Vues:
15
>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.

One simple way to count the records in a big text file when ALINES() mignt not work because of the size is to create a temporary table and suck the file in with APPEND FROM command. Then just get the record count and dump the file. However it may be time consuming.
I recently used this method to count the lines in 50Mb text file with ~500,000 lines. It took about 7 sec on PC 1 Ghz, 256 MB RAM
CREATE TABLE filecontent (cline c(254))
APPEND FROM myfile.TXT TYPE SDF
?RECCOUNT()
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform