mIRC Home    About    Download    Register    News    Help

Topic Options
#166257 - 08/12/06 11:31 AM echoing lines of a large file
HaleyJ Offline
Fjord artisan

Registered: 01/07/06
Posts: 242
Loc: London the city i love
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
_________________________
Newbie

Top
#166266 - 08/12/06 12:45 PM Re: echoing lines of a large file [Re: HaleyJ]
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
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.
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#166294 - 08/12/06 10:15 PM Re: echoing lines of a large file [Re: starbucks_mafia]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
/play is also much better for echoing all the lines of a text file to a window.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#166299 - 08/12/06 10:45 PM Re: echoing lines of a large file [Re: Riamus2]
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
How do you figure that?
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#166300 - 08/12/06 10:51 PM Re: echoing lines of a large file [Re: starbucks_mafia]
billythekid Offline
Fjord artisan

Registered: 01/03/03
Posts: 612
Loc: Aberdeen, Scotland
i think he meant, in addition to your suggestions, much better than a while loop...
btk


Edited by billythekid (08/12/06 10:52 PM)
_________________________
billythekid

Top
#166301 - 08/12/06 10:56 PM Re: echoing lines of a large file [Re: billythekid]
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
Ah, I see.
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#166304 - 08/12/06 11:22 PM Re: echoing lines of a large file [Re: starbucks_mafia]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Yeah, sorry. I said "also," but I should have made sure that I was replying to the right person.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#166385 - 10/12/06 04:34 AM Re: echoing lines of a large file [Re: Riamus2]
Qb_Master Offline
Pikka bird

Registered: 03/06/04
Posts: 19
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)

Top
#166390 - 10/12/06 05:46 AM Re: echoing lines of a large file [Re: Qb_Master]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
It would definitely be nice to have commands and regular variables expanded to accept longer lines of text.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top