Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
StrToFile on large text file
Message
De
19/06/2008 11:14:59
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01325149
Message ID:
01325461
Vues:
22
>>This being VFP9, we don't care if aLines() returns more than 65000, so that's what I'd do. Get the whole thing into an array, then output lines one by one, inserting the headers as needed.
>
>Still I would expect this be slow on a big (huge) files.

Yes, but 4 MB is not big :).

On a file that's about 2M long,

? SECONDS(), ALINES(aa, FILETOSTR("my_long_program.prg")), SECONDS()

returns 47069 lines in 0.335 seconds. Since I didn't have a larger file at hand,

? SECONDS(), ALINES(aa, REPLICATE(FILETOSTR("my_long_program.prg"),4)), SECONDS()

gives only .377 seconds (probably due to caching), and I had about a dozen other windows open and my machine is no Ferrari. So it's only the time it takes to fwrite() everything, which is a low level operation which is as fast as it gets.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform