>>Maximum # of characters per character string or memory variable--16,777,184
>
>James,
>(not intending any squabble - .2 cents addition:)
>In a previous reply I saw fread() to count lines.
>Real problem with fread() it should be done byte by byte. The code I saw would error on first call to fread. fgets() could be used but it has a bug (cannot handle lines > 8192chars - maybe fixed in SP4?) OTOH for huge files (>1 billion lines < bg >) lowlevel sounds to be the only way (for >2Gb files I don't have an idea what OS response would be).
>IMHO Barbara's original reply is the best with a slight modification (so it's faster than array approach too):
>
>
create cursor dummy (f1 l)
>append from (lcFile) type sdf
>nLines = reccount()
>use in 'dummy'
>Best regards
>Cetin
Yes, in this example should be fgets(). I had 5 mln records text comma-delimited file. I appended to the dbf file with the exact structure. It took about 20-30 minutes to append. No indexes were in this DBF.
I'll try both solutions on this file, to see, that's the fastest approach.
Thanks for ideas.
If it's not broken, fix it until it is.
My Blog