Thanks.
I have a 10,000+ text file with userhostmasks. I need help with reading it into a hash table called iptracker. I understand how to /hmake -s iptracker 1000 | /hadd -s iptracker $nick[12345678_12345678@1.2.3.4] | hname/hsave -so text iptracker.hsh | /hload -so iptracker iptracker.hsh | /hfree iptracker | etc.
Each line in the text file is in the format:
screenname[12345678_12345678@1.2.3.4
/hmake -s iptracker 1000
/hsave -so iptracker iptracker.hsh
//var %a = 1, %b = $read(iptracker.txt,1) | echo -s %a %b | while %a <= %b { var %c = $read(iptracker.txt,%a) | echo -s %c | var %nick = $gettok(%c,1,91) | /hadd -s iptracker %nick %c | inc %a | unset %nick %c }
This works... but is there a better way?
RusselB's example to read a hash file:
//var %a = 1, %b = $hget(<table>,0).item | while %a <= %b { echo -a $hget(<table>,%a).item is $hget(<table>,%a) | inc %a }
Fixed:
//var %a = 1, %b = $hget(<table>,0).item | while %a <= %b { echo -a $hget(<table>,%a).item is $hget(<table>,%a).data | inc %a }