Re: is it possible to readfromfile line x to y
turns out when i try to parse the lines 1 by 1 (after just loading the file) in 9.05 there is no crash and the process finishes...albeit slowly. will report bug for 9.04. thanks for all the suggestions, learned alot by asking you guys and investigating workaround. On Sat, Aug 10, 2019 at 3:06 PM hh via use-livecode < use-livecode@lists.runrev.com> wrote: > 1. Read for N lines reads sequentially, doesn't need an offset. > 2. You could instead try to do that in one strike: > >put url ("file:"&) into str >filter str with "*" > > typical line for further extracting: > U+1F600 > > ___ > use-livecode mailing list > use-livecode@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
1. Read for N lines reads sequentially, doesn't need an offset. 2. You could instead try to do that in one strike: put url ("file:"&) into str filter str with "*" typical line for further extracting: U+1F600 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
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@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@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@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@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@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
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 > 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@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@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
Did you already try (use a counter add 42 to lineCntr read from file for 42 lines --> placed into it (check the result for empty or "eof") Note. The file contains base64 encoded imagedata (which is in one long line). Such a line may be too long to display in a LC field (-> may cause a hang). So use the data only from variables. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
Sorry about that. The https reference threw me off. Use open file, read file with range (repeatedly), and then close file. open file myBigFile for UTF-8 text read read from file myBigFile at myOffset for myNumLines lines close... Adjust myOffset with the length of what was read each time. > On Aug 10, 2019, at 11:26 AM, Tom Glod via use-livecode > 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@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@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
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@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: is it possible to readfromfile line x to y
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 > 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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
is it possible to readfromfile line x to y
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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode