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

	<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>2009-04-12T04:13:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Fill]]></name></author>
		<updated>2009-04-12T04:13:18-04:00</updated>

		<published>2009-04-12T04:13:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88399#p88399</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88399#p88399"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88399#p88399"><![CDATA[
ahmm, I get it... thanks for the great help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10430">Fill</a> — Sun Apr 12, 2009 4:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-04-11T17:07:30-04:00</updated>

		<published>2009-04-11T17:07:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88395#p88395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88395#p88395"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88395#p88395"><![CDATA[
Fill:<br>That depends on what you hope to achieve:<br>If you are trying to create a list with a single item, containg the whole of $text, that'll work ("lindex [list $list] 0" will return the whole content of $text).<br>If, however, you are trying to make each word within $text a separate list item, that will not work. Instead, you should be looking at split (Ie: "lindex [split $list] 0" will return the first word in $text).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Apr 11, 2009 5:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fill]]></name></author>
		<updated>2009-04-11T13:51:17-04:00</updated>

		<published>2009-04-11T13:51:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88391#p88391</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88391#p88391"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88391#p88391"><![CDATA[
wouldn't a [list $text] solve the problem?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10430">Fill</a> — Sat Apr 11, 2009 1:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-04-08T10:14:26-04:00</updated>

		<published>2009-04-08T10:14:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88369#p88369</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88369#p88369"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88369#p88369"><![CDATA[
Just as an aside, many ppl learning Tcl (me included, countless times) have made mistakes by assuming any text returned to a proc from a bind such as PUB can be treated as a list of words. It isn't. Scripts incorrectly treating this argument as a list will choke on special characters.<br><br>The following webpage (dealing with the proper use of split and join commands) is quite well known, and well worth a read.<br><br><a href="http://www.peterre.info/characters.html" class="postlink">http://www.peterre.info/characters.html</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Apr 08, 2009 10:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fill]]></name></author>
		<updated>2009-04-08T03:33:06-04:00</updated>

		<published>2009-04-08T03:33:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88367#p88367</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88367#p88367"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88367#p88367"><![CDATA[
Thanks, worked perfectly  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10430">Fill</a> — Wed Apr 08, 2009 3:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-04-07T21:49:27-04:00</updated>

		<published>2009-04-07T21:49:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88351#p88351</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88351#p88351"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88351#p88351"><![CDATA[
thank you,<br>wasnt sure if join does what it the name says ^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Tue Apr 07, 2009 9:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-04-07T20:28:34-04:00</updated>

		<published>2009-04-07T20:28:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88350#p88350</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88350#p88350"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88350#p88350"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set fp [open "thefile.txt" r]set datalist [split [read $fp] \n]close $fpset datastring [join $datalist]</code></pre></div>Look at the core Tcl commands 'split' and 'join'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Apr 07, 2009 8:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Way2Death]]></name></author>
		<updated>2009-04-07T20:13:07-04:00</updated>

		<published>2009-04-07T20:13:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88349#p88349</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88349#p88349"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88349#p88349"><![CDATA[
<blockquote class="uncited"><div>if i may join this thread and ask how to join the seperated words then?<br><br>exactly the opposite thing should be executed if possible:<br><br>foreach word i want it in one line again</div></blockquote>the way i did it was<br>first set empty string<br><div class="codebox"><p>Code: </p><pre><code>set fline ""</code></pre></div>then i did a for each loop..<br>depending if its in a file you would do it like:<br><div class="codebox"><p>Code: </p><pre><code>set fp [open "thefile.txt" r]set data [read $fp]close $fpset data [split $data "\n"]foreach line $data{ set fline "$fline $line"}</code></pre></div>i dont know if there is a better way of doing this.. but this works fine for me<br><br>so basically loop trough everything, and add every word one by one to the  $line string<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10578">Way2Death</a> — Tue Apr 07, 2009 8:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2009-04-07T19:49:38-04:00</updated>

		<published>2009-04-07T19:49:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88348#p88348</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88348#p88348"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88348#p88348"><![CDATA[
if i may join this thread and ask how to join the seperated words then?<br><br>exactly the opposite thing should be executed if possible:<br><br>foreach word i want it in one line again<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Tue Apr 07, 2009 7:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-04-07T18:08:22-04:00</updated>

		<published>2009-04-07T18:08:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88346#p88346</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88346#p88346"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88346#p88346"><![CDATA[
Something like this?<div class="codebox"><p>Code: </p><pre><code>..foreach word [split $text] { puthelp "PRIVMSG #yourchan :$word"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Apr 07, 2009 6:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fill]]></name></author>
		<updated>2009-04-07T17:55:32-04:00</updated>

		<published>2009-04-07T17:55:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88345#p88345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88345#p88345"/>
		<title type="html"><![CDATA[Spliting a message into words]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88345#p88345"><![CDATA[
Hi scripters,<br><br>I'm trying to make a script that splits a message into its' words and sends them to the channel.<br><br>Example:<br>&lt;Fill&gt; testing one two three<br>&lt;Mr.Bot&gt; testing<br>&lt;Mr.Bot&gt; one<br>&lt;Mr.Bot&gt; two<br>&lt;Mr.Bot&gt; three<br><br>Any ideas?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10430">Fill</a> — Tue Apr 07, 2009 5:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
