Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FREAD line by line
Message
From
03/03/2004 09:56:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00882109
Message ID:
00882689
Views:
22
Thanks for the ideas David!

Tracy

>Tracy,
>
>I'll throw one other solution into the mix. That works especially well if your lines are less than 254 characters:
>
>create cursor TheFile ( cLine c(254) )
>append from TheFile.txt type sdf
>
>now you can use a scan loop to iterate the file. If the lines can exceed 254 you can put enough fields into your cursor to handle the max length.
>
>This works with files that would cause alines() to hit array size limits. It has the advantage over fgets() in that you can easily manipulate blocks of lines according to commonalities ie scan for "linetype=1" $ cLine. APPEND FROM works amazingly fast.
>
>>I want to read a file line by line. I know that at the end of each line is a chr(13) followed by a chr(10). I typically read in a set number of bytes til I get to the end of a file, but in this case I want to make sure that I readin line by line. Is there an easy way to do that?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform