mIRC Home    About    Download    Register    News    Help

Print Thread
#65765 28/12/03 11:29 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
this code works ok but i would like to make it echo the number of lines filtered for each matchtext ?

Code:
  
alias test {
  /window -ane @filter
  set %test.lines $lines(test.txt)
  var %g = 1
  while  (%g < %test.lines)  {
    /filter -ww @test @filter * $+ $read(test.txt,%g) $+ *
    inc %g
  }
}



it sorts to the @filter window and i tryed using $filtered but it doesnt seem to work correctly

edit: also when i did get it to echo anything it seems to echo 0 for lines that didnt match is there a way to exclude those lines from being echoed ?

Last edited by Cheech; 28/12/03 11:30 PM.
#65766 28/12/03 11:37 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
Code:
  
alias test {  
  /window -ane @filter  
  set %test.lines $lines(test.txt)  
  var %g = 1  
  while  (%g < %test.lines)  {    
  /filter -ww @test @filter * $+ $read(test.txt,%g) $+ *    
  echo -a $read(test.txt,%g) = $filtered
   inc %g  
  } 
}


ok that works but it still fills up with 0's ?

#65767 28/12/03 11:43 PM
Joined: Dec 2002
Posts: 332
C
Cheech Offline OP
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
nevermind i figured it out i had it in the wrong order smile

Code:
  
alias test {
  /window -ane @filter
  set %test.lines $lines(test.txt)
  var %g = 1
  while  (%g < %test.lines)  {
    /filter -ww @test @filter * $+ $read(test.txt,%g) $+ *
    if ( $filtered == 0 ) {
      inc %g 
    }
    else {
      echo -a 04 $read(test.txt,%g) = $filtered
      inc %g
    }
  }
}



Link Copied to Clipboard