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

	<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>2007-05-21T12:16:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-21T12:16:50-04:00</updated>

		<published>2007-05-21T12:16:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72888#p72888</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72888#p72888"/>
		<title type="html"><![CDATA[Search in file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72888#p72888"><![CDATA[
In this case it'd be a matter of using a <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/foreach.htm" class="postlink">foreach</a>-loop to iterate through the list of lines.<br><br>Within that loop, split the current line into a list, and use lindex to extract the id number.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon May 21, 2007 12:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-05-21T11:15:40-04:00</updated>

		<published>2007-05-21T11:15:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72883#p72883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72883#p72883"/>
		<title type="html"><![CDATA[Search in file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72883#p72883"><![CDATA[
<a href="http://johoho.eggheads.org/eggdrop/other/guide2tcl.html" class="postlink">Beginners Guide to TCL</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon May 21, 2007 11:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[The_Deputy]]></name></author>
		<updated>2007-05-21T04:36:29-04:00</updated>

		<published>2007-05-21T04:36:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72880#p72880</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72880#p72880"/>
		<title type="html"><![CDATA[Search in file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72880#p72880"><![CDATA[
At this moment I have this code which give me all the lines printed out<br><br>set in [open "filename.dat" r]<br>set line [split [read $in] \n]<br>close $in<br>puts [lindex $line]<br><br>so after the close command I have to search with the index I guess<br><br>How can I do this ?<br>On the internet isn't much information on learning tcl scripting <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9004">The_Deputy</a> — Mon May 21, 2007 4:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-18T11:06:46-04:00</updated>

		<published>2007-05-18T11:06:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72817#p72817</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72817#p72817"/>
		<title type="html"><![CDATA[Search in file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72817#p72817"><![CDATA[
I guess you could approach this in several different ways, I'd suggest you open the file and read it line by line, using a "while {![eof $fid]} {.." loop.<br>Then <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/split.htm" class="postlink">split</a> each line into a list, and use <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/lindex.htm" class="postlink">lindex</a> to extract the identifier number. If it matches, print the line, otherwize move on to the next line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri May 18, 2007 11:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[The_Deputy]]></name></author>
		<updated>2007-05-18T10:02:44-04:00</updated>

		<published>2007-05-18T10:02:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72814#p72814</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72814#p72814"/>
		<title type="html"><![CDATA[Search in file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72814#p72814"><![CDATA[
Hello, <br><br>I have a file which contains a kind of addressbook eg:<br>1 Robert Cook Road_Seven_98 Beverly_Hills 081023445<br>2 Peter Cook Road_Seven_98 Beverly_Hills 08934752435<br><br>end so on.<br>The format of this file is Identifier [SPACE] Firstname [SPACE] Lastname [SPACE] Address [SPACE] City [Space] Phonenumber<br><br>I'd like to have an IRC script which provide me the info of a person based on the identifier by example in IRC i do /msg botnick address1 and that the bot answers with the line 1 of the file<br><br>Could anyone help me, I'm not a TCL specialist and I get stuck after trying several things<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9004">The_Deputy</a> — Fri May 18, 2007 10:02 am</p><hr />
]]></content>
	</entry>
	</feed>
