<?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/11963" />

	<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>2006-06-06T18:59:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-06-06T18:59:18-04:00</updated>

		<published>2006-06-06T18:59:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63777#p63777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63777#p63777"/>
		<title type="html"><![CDATA[How to find out if the line exists in textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63777#p63777"><![CDATA[
well, I assume when the script can post a specific line, it probably uses an '[lindex $listoflines [expr {$arg + 1}]]' statement. To check in such a case, a simple<div class="codebox"><p>Code: </p><pre><code>if {[llength $listoflines] &lt; $arg} {#  no such line} else {#  ok, lets print}</code></pre></div>could be used<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue Jun 06, 2006 6:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2006-06-06T17:06:32-04:00</updated>

		<published>2006-06-06T17:06:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63774#p63774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63774#p63774"/>
		<title type="html"><![CDATA[How to find out if the line exists in textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63774#p63774"><![CDATA[
Simple, open the file and use a loop to incr a variabile with the number of lines, then close the file and return the number of lines.<div class="codebox"><p>Code: </p><pre><code>proc count:lines {file} {  if {![llength $file]} return  set lines 0  set f [open $file r]  while {[gets $f foo]&gt;-1} {     incr lines  }  close $f  return $lines}</code></pre></div>Not tested but should work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jun 06, 2006 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-06-06T14:58:00-04:00</updated>

		<published>2006-06-06T14:58:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63770#p63770</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63770#p63770"/>
		<title type="html"><![CDATA[How to find out if the line exists in textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63770#p63770"><![CDATA[
Hello!<br>I made a script that shows me a line of a textfile. For example with "!showline 2" my bot shows the second line of the file. But how can I find out if this line exists, e.g. if the file only has one line?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Tue Jun 06, 2006 2:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
