This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

file-search?

Old posts that have not been replied to for several years.
Locked
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

here's the prob. I'm working on a script which contains alot of info..so I put it in txt files. U can do !search <word> and the script gives a reply to that. Now what I can't figure out is... How do I code it so that if I search for "swed", it searches for any word in the txt file starting with
"swed"?..ex "sweden"

I've used:

while {![eof $fs]} {
gets $fs line
if {$line == $arg} { set found 1 }
}
if {$found} {

to search for the entire words...and it works just as I want it to.
T
Thor

Post by Thor »

if {$line == $arg} { set found 1 }

if u use a
{[string match *$arg* $line]} { set found 1 }
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Forgot to post that I actually found out how to do it on my own, but thx anyway =)

Now a new question... I'm on a new but similar script. If u do !add xx:xx:xx How can u split up the xx:xx:xx and make the script recoginse if it is one or two ":" in the arg?

say if u have !add 11:11 it sees that the arg has one ":" and puts that in a file...or it sees that it is two ":" in !add 11:11:11
and put that in a different file...
Locked