mIRC Homepage
Posted By: Buggs2008 txt question - 13/06/08 07:43 PM
Hello,

I am trying to read a text file given the following first key words at the beggining of the line:

OWNER,HOST,DENY,GRANT

This is what I have so far:

Code:
 
alias test {
  var %x = OWNER,HOST,DENY,GRANT
  var %a = $read(accesslist.txt, w, * $+ %x $+ *)
  echo -a $gettok(%a,1,9) $gettok(%a,2,9) $gettok(%a,3,9) $gettok(%a,4,9) $gettok(%a,5,9) 
}


Whats in the text file:

HOST *!5f67d56b2beb4a8b8ff3433eea054532@* Nickname Indefinite NONE
DENY *!*@123.123.123.* Nickname Indefinite IP BAN: Nickname

I would like to use the alias to basically echo me back each entire line that has OWNER HOST DENY GRANT ect.

Example:

DENY *!*@123.123.123.* Nickname Indefinite IP BAN: Nickname

Please help.

Thanks in advance,

J
Posted By: Wims Re: txt question - 13/06/08 07:55 PM
You should use /filter, something like :
Code:
//filter -g yourfile.txt out.txt /^(OWNER|HOST|DENY|GRANT).+/
Out.txt will contain the line that has matched
Posted By: Buggs2008 Re: txt question - 13/06/08 07:59 PM
Hi Wims,

Its basically exported data to begin with, I dont really want to export it twice, so by echoing the lines back to me, I know that I have the data I need so that I can import it back to mIRC

Any more suggestions.

Jay
Posted By: Wims Re: txt question - 13/06/08 08:59 PM
Ok, so try this instead :
Code:
filter -kg yourfile.txt youralias /^(OWNER|HOST|DENY|GRANT).+/
and in the remote, put this :
Code:
alias youralias echo -a $1-
Posted By: Buggs2008 Re: txt question - 14/06/08 03:57 PM
Hi Wims,

Thanks very much, it worked perfect and in the right context that I wanted.

Thank you so much for helping me out

Cheers,

Jay
© mIRC Discussion Forums