read from file until a line begins with a certain word

Colin Holgate colinholgate at gmail.com
Sun Sep 17 00:20:15 EDT 2017


One thought, what if you read overlapping chunks. Like, read from 0-10000, then from 9900-20000, etc. If the overlap is longer than your test string you would still be able to pick it up, in the cases where the string spanned the chunk boundary.

First test could be to read in 10000 chunks and time how long that takes compared to reading in 1000000 at a time, or 1000000000 at a time. There may be a sweet spot where reading in the text is fast enough to not bother with reading in smaller chunks.


> On Sep 16, 2017, at 9:11 PM, dunbarx via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I would just read the whole file and then let LC truncate the text following
> the keyword sentence in the usual ways. I bet even with a couple of
> gigabytes this would not take much time.
> 
> Craig Newman
> 
> 
> 
> --
> Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list