mIRC Home    About    Download    Register    News    Help

Print Thread
#9891 06/02/03 03:49 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
I'm sure there is a really simple way to do this, but how can I loop through the following:

Code:
/write -ds $+ $nick channel_manager.txt


There may be mutiple entries in the txt file with the nickname, and I need it to delete all of them.

Thanks guys!

#9892 06/02/03 04:16 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
while ($read(channel_manager.txt,s,$nick)) write $+(-ds,$nick) channel_manager.txt


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#9893 06/02/03 05:45 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
A much more efficient way than $read and /write in a loop is /filter:
Code:
/filter -ffcx channel_manager.txt channel_manager.txt $nick $+ *


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#9894 06/02/03 10:37 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
That's probably true, if there are lots of lines starting with $nick - perhaps not if there are only a small number of lines containing $nick. And I forgot about filter's -x switch. blush


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard