mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2004
Posts: 13
S
ScottK Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2004
Posts: 13
hello
my code isn't works to filter the 1st,3rd text on the line of text

example
Quote:

in nick.txt

MouglyMoron®Wednesday®mmoi@oper.webchat.org
ScottKGei®Wednesday®scott@oper.webchat.org
TabathaFatChick®Thursday®tabatha@oper.webchat.org


i want filter the nick.txt to nick-tmp.txt with 1st & 3rd words from ® as line separator

Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
The line MouglyMoron®Wednesday®mmoi@oper.webchat.org
So you basically want to store MouglyMoron®mmoi to nicks-temp.txt?

Joined: Dec 2004
Posts: 13
S
ScottK Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2004
Posts: 13
® & @ are different , noticed that

MouglyMoron®mmoi@oper.webchat.org <= the result must be like this
someone pls ?

Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Yeah I noticed that and that's the output I thought and created. Was just making sure before I posted the code smile

Put this in your Remotes section of the Script Editor (if you didn't already know, if so, my apologizes)

Code:
alias filter.nicks {
; ensure the file 'nick.txt' exists and isnt empty
  if (($file(nick.txt)) &amp;&amp; ($lines(nick.txt))) {
; clear the temporary file before writing to it
    write -c nick-temp.txt
; filter 'nick.txt' using the alias 'filter.nicktemp'
    filter -fk nick.txt filter.nicktemp
  }
}
alias filter.nicktemp {
; write the output to nick-temp.txt
; the $deltok($1,2,174) simply removes the second token
; delimited by 174 which is ®, then writes the output to
; the file
  write nick-temp.txt $deltok($1,2,174)
}


You can just remove the comments if you like, just trying to explain the code so you get an idea on how to do some things smile

Last edited by nycdiesel; 22/01/05 05:01 AM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
//echo -a $gettok(MouglyMoron®Wednesday®mmoi@oper.webchat.org,1,174) $+ $chr(64) $+ $gettok(MouglyMoron®Wednesday®mmoi@oper.webchat.org,3,174)

Last edited by SladeKraven; 22/01/05 05:05 AM.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
  • alias nickfilter write -c nick-tmp.txt | filter -k nick.txt _nickfilt
    alias -l _nickfilt write nick-tmp.txt $deltok($1,2,174)

Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
much smaller ;P

Joined: Dec 2004
Posts: 13
S
ScottK Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2004
Posts: 13
thx so much
thx thx thx :tongue:


Link Copied to Clipboard