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:
00796981
Vues:
10
>>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()
>
Hi Nick,

Interesting. Wouldn't it be faster if
CREATE TABLE filecontent (cline c(1))
?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform