<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/5942" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-11-02T21:42:09-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/5942</id>

		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-11-02T21:42:09-04:00</updated>

		<published>2003-11-02T21:42:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29385#p29385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29385#p29385"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29385#p29385"><![CDATA[
This should do the trick <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><div class="codebox"><p>Code: </p><pre><code>#Usage: [find:text &lt;nick&gt; &lt;filename.txt&gt; &lt;search string&gt;] proc find:text {nick filename arg} {   set count "0"   set rfile [open "$filename" "r"]   while {![eof $rfile]} {     gets $rfile line     if {[string match "*[string map {\x20 *} $arg]*" $line]} {       putserv "PRIVMSG $nick :$line"       set count [expr $count+1]     }   }   close $rfile   if {$count == 0} {     return 0   }  if {$count != 0} {     return 1  }  }</code></pre></div>forgot a return breaked a loop :/ sorry hehe and forgot about the nick var<br>puts serv is just optional stuff so is the return its for usage in other procs depends how your using it .. just to give an idea on how you could do it .. you also can set max results by setting if $count &lt; 10 for example .. and so on if $count &gt; 10 then putserv to mutch results .. or something<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Nov 02, 2003 9:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-10-30T07:05:11-04:00</updated>

		<published>2003-10-30T07:05:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29187#p29187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29187#p29187"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29187#p29187"><![CDATA[
Alternativly, use the fileutil package that comes with <a href="http://tcllib.sf.net/" class="postlink">TclLib</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 30, 2003 7:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-10-30T03:20:56-04:00</updated>

		<published>2003-10-30T03:20:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29183#p29183</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29183#p29183"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29183#p29183"><![CDATA[
Have a look at <a href="http://forum.egghelp.org/viewtopic.php?p=24833" class="postlink">this</a> post.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Oct 30, 2003 3:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-30T03:09:55-04:00</updated>

		<published>2003-10-30T03:09:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29182#p29182</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29182#p29182"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29182#p29182"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>#Usage: [find:text &lt;filename.txt&gt; &lt;search string&gt;]proc find:text {filename arg} {  set count "0"  set rfile [open "$filename" "r"]  while {![eof $rfile]} {    gets $rfile line    if {[string match "*[string map {\x20 *} $arg]*" $line]} {      putserv "PRIVMSG $nick :$line"      set count [expr $count+1]      return 1    }  }  close $rfile  if {$count == 0} {    return 0  }}</code></pre></div></div></blockquote>There's no variable called 'nick' in that proc. Also, returning from inside the loop will leave the file open (you must have meant 'break' <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> ).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Oct 30, 2003 3:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-10-29T16:56:14-04:00</updated>

		<published>2003-10-29T16:56:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29157#p29157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29157#p29157"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29157#p29157"><![CDATA[
is it to create @find cause i got a script that does that ..<br><br>script below is like smal sample script you could use for that havn't tested it yet tho so let me know if it does .. <br><div class="codebox"><p>Code: </p><pre><code>#Usage: [find:text &lt;filename.txt&gt; &lt;search string&gt;]proc find:text {filename arg} {  set count "0"  set rfile [open "$filename" "r"]  while {![eof $rfile]} {    gets $rfile line    if {[string match "*[string map {\x20 *} $arg]*" $line]} {      putserv "PRIVMSG $nick :$line"      set count [expr $count+1]      return 1    }  }  close $rfile  if {$count == 0} {    return 0  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Oct 29, 2003 4:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-10-28T08:04:48-04:00</updated>

		<published>2003-10-28T08:04:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29087#p29087</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29087#p29087"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29087#p29087"><![CDATA[
there was a tread like this one just some days ago<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Tue Oct 28, 2003 8:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-10-28T06:22:44-04:00</updated>

		<published>2003-10-28T06:22:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29084#p29084</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29084#p29084"/>
		<title type="html"><![CDATA[function similar grep for unix]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29084#p29084"><![CDATA[
Hi, i'm looking for a function that find a string in a txt file. <br><br>If in my raiden.txt i have a string "hello", is in tcl a function that return 0 if it exists ?<br><br>Excuse my bad english.<br><br>Regards<p>Statistics: Posted by Guest — Tue Oct 28, 2003 6:22 am</p><hr />
]]></content>
	</entry>
	</feed>
