mIRC Home    About    Download    Register    News    Help

Print Thread
txt question #200854 13/06/08 07:43 PM
Joined: Oct 2007
Posts: 214
B
Buggs2008 Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
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

Re: txt question [Re: Buggs2008] #200856 13/06/08 07:55 PM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
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

Last edited by Wims; 13/06/08 07:56 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: txt question [Re: Buggs2008] #200857 13/06/08 07:59 PM
Joined: Oct 2007
Posts: 214
B
Buggs2008 Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
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

Re: txt question [Re: Buggs2008] #200861 13/06/08 08:59 PM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
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-


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: txt question [Re: Buggs2008] #200901 14/06/08 03:57 PM
Joined: Oct 2007
Posts: 214
B
Buggs2008 Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
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