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

	<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-02-14T06:32:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-14T06:32:12-04:00</updated>

		<published>2003-02-14T06:32:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16584#p16584</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16584#p16584"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16584#p16584"><![CDATA[
<blockquote class="uncited"><div>btw.. love your "graphical" demonstration GodOfSuicide <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"></div></blockquote>that was the way i do it in delphi....so i tried to symbolize my way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Feb 14, 2003 6:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-02-14T06:18:34-04:00</updated>

		<published>2003-02-14T06:18:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16583#p16583</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16583#p16583"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16583#p16583"><![CDATA[
Make it four!<br><br>set fullfile "/path/to/file.ext"<br>regexp {(^.*)/([^/]*$)} $fullfile match dirname filename<br><br>ppslim's way is best though<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Feb 14, 2003 6:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-14T06:08:41-04:00</updated>

		<published>2003-02-14T06:08:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16582#p16582</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16582#p16582"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16582#p16582"><![CDATA[
Haha, now you have 3 types to choose from <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=187">caesar</a> — Fri Feb 14, 2003 6:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-02-14T05:41:07-04:00</updated>

		<published>2003-02-14T05:41:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16578#p16578</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16578#p16578"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16578#p16578"><![CDATA[
Tcl has a lovely set of built in commands, for operating on filenames.<br><br>What makes it even better, it works on ALL OS's. Meanign there are nor incompatabilities between scripts.<br><div class="codebox"><p>Code: </p><pre><code>set fullfile "/my/file/is/here/and/called/ppslim.doc"set dirname [file dirname $fullfile]set filename [file tail $fullfile]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Fri Feb 14, 2003 5:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-02-14T04:59:01-04:00</updated>

		<published>2003-02-14T04:59:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16570#p16570</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16570#p16570"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16570#p16570"><![CDATA[
or:<div class="codebox"><p>Code: </p><pre><code>set line "/path/to/a/dir/and/file.txt" set dir [lindex [split $line /] end]  #will return "file.txt"set file [join [lrange [split $line /] 0 end-1] /]  #will return "/path/to/a/dir/and"</code></pre></div>this will give you both dir and filename, even if you don't know the filename<br><br>btw.. love your "graphical" demonstration GodOfSuicide <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Feb 14, 2003 4:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-14T04:47:10-04:00</updated>

		<published>2003-02-14T04:47:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16569#p16569</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16569#p16569"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16569#p16569"><![CDATA[
set line "/path/to/a/dir/and/file.txt"<br>set result [string trim $line "file.txt"]<br><br>result: /path/to/a/dir/and/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 14, 2003 4:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-02-14T04:42:16-04:00</updated>

		<published>2003-02-14T04:42:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16568#p16568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16568#p16568"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16568#p16568"><![CDATA[
i'm not that good in tcl, but i can tell you what logical way you have to go:<br><br>cos in the filename ther cant be a "/" character you have to find the position of the last "/" in the string.<br><br>Then copy all from first character in the string to the position you just found into a variable. Do the same from the position you found + 1 to the last character. Then you have split it up.<br><br>/path/to/a/dir/and/file.txt <br>______________|<br>                 find this one <br><br>/path/to/a/dir/and/file.txt <br>|---------------------|<br>copy from start till last "/"<br><br>/path/to/a/dir/and/file.txt <br>_______________|------|<br>copy from last "/" + 1 to end.<br><br>now somebody who knows TCL got to write the code, but i hope my theoretical method can help.<br><br>(board unformated my " "'s, so i just made "_"'s)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Feb 14, 2003 4:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sirkrunch]]></name></author>
		<updated>2003-02-14T04:18:49-04:00</updated>

		<published>2003-02-14T04:18:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16566#p16566</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16566#p16566"/>
		<title type="html"><![CDATA[splitting strings]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16566#p16566"><![CDATA[
I have this<br>$string /path/to/a/dir/and/file.txt<br><br>i want to split it, have one variable with the full path but no file<br>and another with just the fille name, how do i go about that??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2010">sirkrunch</a> — Fri Feb 14, 2003 4:18 am</p><hr />
]]></content>
	</entry>
	</feed>
