mIRC Homepage
Posted By: ots654685 infile search - 01/10/08 08:38 AM
probably asked many times before but i'm unable to find any topic that fit my needs.

I'm trying to create a search script (prefering ini file) for multiple purpose.
That way i only need 1 file to make (instead of 6) and keeps it simple.

Only disadvantage using ini is that every item in topic needs different numbers.


but searching ini is much more simple as in *.txt or *.dat.

alias search {
if (readini(ini,topic,word) == $1-) {
aline @search $1-

and for *.txt (found in other topic)

alias search2 {
var %find = $1-
var %ax = 0
var %file = $mircdirfile.dat
window -ak0SC @search 300 200 603 322
var %xlines = $lines(%file)
while (%ax <= %xlines) {
inc %ax
if (%find isin $read(%file,n,%ax)) { aline @search $read(%file,n,%ax) }

But in both situations i'm unable to search for just a piece of what the actual search was about.

/search Test gives everything with Test in it aka Test,Test2,Test3 etc.

But it won't work when i do this and only "Test" is in file.dat

/search This.is.a.test
/search This is a test

There is test in both but it gives me no results

Is there an easy way to fix this?
Posted By: RusselB Re: infile search - 01/10/08 09:01 AM
Searching a non-ini formatted file is simple.
That is at least part of the reason the $read identifier has the s, w, and r switches.
/help $read

As to searching an ini file, usage of a hash table or the /filter command look like your best bets.
© mIRC Discussion Forums