mIRC Homepage
Posted By: HaleyJ echoing lines of a large file - 08/12/06 11:31 AM
Hello
I have a file with 306706 lines in it. when i use a while to loop through all the lines and echo them into a window mIRC will crash after say 400 lines. Any ideas on why this is happening or any workarounds would be appreciated.
Thanks
Posted By: starbucks_mafia Re: echoing lines of a large file - 08/12/06 12:45 PM
Well I don't know why it would crash after 400 lines but you'll never get 306706 lines into a window anyway, there's a limit on the number of lines a window can hold in it's buffer (display at once).

As a note, if you're putting the entire file into the window you can use loadbuf or filter and it'll be thousands of times faster than looping with $read(), however that still won't overcome the window buffer limit I mentioned. There's no way to get around that as far as I'm aware.
Posted By: Riamus2 Re: echoing lines of a large file - 08/12/06 10:15 PM
/play is also much better for echoing all the lines of a text file to a window.
Posted By: starbucks_mafia Re: echoing lines of a large file - 08/12/06 10:45 PM
How do you figure that?
Posted By: billythekid Re: echoing lines of a large file - 08/12/06 10:51 PM
i think he meant, in addition to your suggestions, much better than a while loop...
btk
Posted By: starbucks_mafia Re: echoing lines of a large file - 08/12/06 10:56 PM
Ah, I see.
Posted By: Riamus2 Re: echoing lines of a large file - 08/12/06 11:22 PM
Yeah, sorry. I said "also," but I should have made sure that I was replying to the right person.
Posted By: Qb_Master Re: echoing lines of a large file - 10/12/06 04:34 AM
I have the same issue when I'm working with downloaded HTTP data. Long lines of text are hard to break up using a while loop, especially if you're analyzing the file for html tags b/c if you break them up at the wrong point some tags may be still left in there.

P.S: If you think that's hard, try working with POSTdata files - in order to tell where each file in that list started I actually had to have it read a set amount, then read that minus 25 in position, then minus 50, then minus 75 before going on to read the next section of data lol. Now that was some crazy stuff! (Analyzing lengths of binary for certain values is not quite easy)
Posted By: Riamus2 Re: echoing lines of a large file - 10/12/06 05:46 AM
It would definitely be nice to have commands and regular variables expanded to accept longer lines of text.
© mIRC Discussion Forums