mIRC Home    About    Download    Register    News    Help

Print Thread
/filter .txt with line separator #108759 22/01/05 04:03 AM
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

Re: /filter .txt with line separator #108760 22/01/05 04:52 AM
Joined: Dec 2004
Posts: 81
N
nycdiesel Offline
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?

Re: /filter .txt with line separator #108761 22/01/05 04:55 AM
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 ?

Re: /filter .txt with line separator #108762 22/01/05 05:00 AM
Joined: Dec 2004
Posts: 81
N
nycdiesel Offline
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.
Re: /filter .txt with line separator #108763 22/01/05 05:02 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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.
Re: /filter .txt with line separator #108764 22/01/05 05:12 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
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)

Re: /filter .txt with line separator #108765 22/01/05 05:16 AM
Joined: Dec 2004
Posts: 81
N
nycdiesel Offline
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
much smaller ;P

Re: /filter .txt with line separator #108766 23/01/05 09:53 AM
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: