is it possible to readfromfile line x to y

Tom Glod tom at makeshyft.com
Sat Aug 10 14:43:00 EDT 2019


thank you both..... the offset is what i was looking for, this way I can
read just a few lines at a time

I also must read them in sequence so I do have to use the line counter
sequentially.

There are probably many reasons why it hands the way i was doing it.

Thankfully I only have to do this one time to parse out the single unicode
character from each line. So 99% of the characters on each line are getting
dropped.

Thanks again


On Sat, Aug 10, 2019 at 2:06 PM Dar Scott Consulting via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Oh, and that repeat will take a very long time. Fixing that might be
> better than the other solution.
>
> Use repeat for each line this_line of unicode_file_to_parse
>
> and don't forget to clear unicode_file_to_parse after the repeat if it is
> not handler local
>
> > On Aug 10, 2019, at 11:26 AM, Tom Glod via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> > Hi Dar, thanks for the tips.  However I am loading the file locally.
> >
> > The file is 48mb, so it loads fine and fits fine.
> >
> > I am attempting to parse just 1 line at a time, but it still doesn't
> work.
> >
> > This is my code and even this freezes it.
> >
> >
> -----------------------------------------------------------------------------------------
> >
> > local number_of_lines
> > local this_line
> > global TempArray
> >
> > put the number of lines in unicode_file_to_parse into number_of_lines
> >
> > repeat with x = 1 to number_of_lines
> >
> > put line x of unicode_file_to_parse into this_line
> >
> > put this_line into TempArray[x]
> >
> > end repeat
> >
> >
> >
> > On Sat, Aug 10, 2019 at 1:16 PM Dar Scott Consulting via use-livecode <
> > use-livecode at lists.runrev.com> wrote:
> >
> >> Remember to unload after load and parsing (if you use load).
> >>
> >> Also, look for variables you are leaving full of big things.
> >>
> >> If that doesn't help enough, look at the httpHeaders property. Use the
> >> Range request header. Unfortunately, that might be limited to byte as a
> >> unit. If so, you might also want to add a Accept-Charset header to limit
> >> the charset to utf-16 so you don't split a character in a read.
> >>
> >> A quick scripting but slow running interim alternative might be to URL
> the
> >> file, get the lines you want, and then empty the variable containing the
> >> file.
> >>
> >>> On Aug 10, 2019, at 9:18 AM, Tom Glod via use-livecode <
> >> use-livecode at lists.runrev.com> wrote:
> >>>
> >>> I am trying to parse this massive html page of unicode characters.
> >>>
> >>> https://unicode.org/emoji/charts/full-emoji-list.html
> >>>
> >>> and livecode is choking up when I read in the whole file and try to
> parse
> >>> each line using a loop.  I get a hard crash in the debugger and a
> endless
> >>> loop when debugger is off.
> >>>
> >>> I will report this afterwards.
> >>>
> >>> But as a workaround I'd like to
> >>>
> >>> "read from file line 1 to 5 of file"
> >>>
> >>> The examples are just not helping me to get the right syntax.  Can
> >> someone
> >>> help me?
> >>>
> >>> I'm parsing lines.
> >>>
> >>> Thanks,
> >>>
> >>> Tom
> >>> _______________________________________________
> >>> 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
> >>
> >>
> >> _______________________________________________
> >> 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
> >>
> > _______________________________________________
> > 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
>
>
> _______________________________________________
> 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