mIRC Home    About    Download    Register    News    Help

Print Thread
Reading from text file help #266383 26/11/19 07:40 AM
Joined: May 2013
Posts: 117
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 117
I have a text file capture data from users. The text reads as follow (have deleted the IP',s )

TallM=Q TallM!webchat@zairc-le0.iie.159.169.IP.....
Buck=Q Buck!webchat@zairc-7q1.slu.6.196IP.....
treble-bb=N treble!Mutter@zairc-6d9.e5a.13.41IP.....
CoCo=N coco!coco@zairc-sgp.b9t.226.160IP.....
kokkie=Q kokkie!NewDawn@zairc-sgp.b9t.226.160IP.....
Nikita=Q Nikita!androirc@zairc-cmh.j2r.13.41IP.....
Water365=Q Water365!irccloud.com@zairc-0msm07IP.....

I would like to extract the info for a specific user name like say trebble-bb in other word the text before the = and display the full line

something like if ($2* iswm $nick) .......

Is that at all possible?

I use this to extract other info for the nick but then that text file contains only the user name.like trebble-bb

Quote

ON *:TEXT:!infonick*:#: {
if ($nick isop $chan) {
var %foundInTheList = $read(Docs\email.txt, w, $2)
if (%foundInTheList) {
.msg $chan $2 we already have your emai address. Thank you.
}
else {
.msg $chan 4 Ons weet nie hoe $2 lyk nie.
}

Re: Reading from text file help [Re: raycomp] #266385 26/11/19 03:54 PM
Joined: Jan 2004
Posts: 1,226
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,226
Based on your example, if you want to match a nick contained in $2 then your wildcard match would be like $read(Docs\email.txt, ntw, $+($2,=,*))

Reminder that with $read you should always use the nt switches unless you specifically intend to evaluate $identifier and %var strings which might be contained in the text file, or intend that a numeric line#1 be handled as if it's the true number of remaining lines in the text file.

Re: Reading from text file help [Re: maroon] #266386 26/11/19 05:19 PM
Joined: May 2013
Posts: 117
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 117
Thank you maroon works perfectly

Last edited by raycomp; 26/11/19 05:19 PM.