mIRC Homepage
Posted By: Loki12583 mIRC can't handle reading my file? - 23/10/07 05:57 AM
I don't like how my college class search is set up so I'm parsing through to see which classes fill two or more gen ed requirements. It works. But mIRC seems to crash around line 800. Once I saw it get to around line 2,000. There are about 30,000 lines.

Code:
alias doit {
  var %file = stupid.txt
  var %i = 1
  var %lines = $lines(%file)
  while (%i <= %lines) {
    var %read =  $read(%file,%i)
    if (General Education Course:*:* iswm %read) {
      echo -s Line: $readn $+ : %read
    }
    inc %i
  }
}
Posted By: RusselB Re: mIRC can't handle reading my file? - 23/10/07 07:31 AM
I'm not sure why this is happening, and I don't see anything wrong with your code. Here, however, is an alternative code that I think should work (I don't have a file that size to test it)
Code:
alias doit {
  if !$hget(classes) { .hmake classes 5000 }
  if $exists(stupid.txt) { .hload -n classes stupid.txt }
  var %i = 1, %lines = $hfind(classes,General Education Course:*:*,0,w)
  while %i <= %lines {
    var %line = $hfind(classes,General Education Course:*:*,%i,w)
    echo -s Line: %line $+ : $hget(classes,%line)
    inc %i
  }
}

Posted By: deegee Re: mIRC can't handle reading my file? - 23/10/07 08:20 AM
Or you could use /filter.
Code:
alias doit {
  filter -fkn stupid.txt _stupid General Education Course:*:*
}
alias -l _stupid {
  tokenize 32 $1
  echo -s Line: $1: $2-
}

Posted By: RusselB Re: mIRC can't handle reading my file? - 23/10/07 09:21 AM
Nicely done deegee. I looked at /filter but haven't used it enough to realize how effective it would actually be for this.
Posted By: Loki12583 Re: mIRC can't handle reading my file? - 23/10/07 03:19 PM
Thank you deegee, that worked perfectly.
© mIRC Discussion Forums