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

	<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>2017-06-22T09:46:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2017-06-22T09:46:01-04:00</updated>

		<published>2017-06-22T09:46:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106340#p106340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106340#p106340"/>
		<title type="html"><![CDATA[Remove a concrete blank character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106340#p106340"><![CDATA[
That's why I like programming so much, and especially eggdrop.<br><br>The same results can be obtained in several ways.<br><br>Thanks to silentziler and caesar for sharing alternatives.  <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=12499">juanamores</a> — Thu Jun 22, 2017 9:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2017-06-22T00:41:04-04:00</updated>

		<published>2017-06-22T00:41:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106338#p106338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106338#p106338"/>
		<title type="html"><![CDATA[Remove a concrete blank character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106338#p106338"><![CDATA[
First format:<div class="codebox"><p>Code: </p><pre><code>% set liveme "Janis Joplin - Piece Of My Heart"Janis Joplin - Piece Of My Heart% set pos [lsearch $liveme "-"]2% lrange $liveme 0 [expr $pos - 1]Janis Joplin% lrange $liveme [expr $pos + 1] endPiece Of My Heart</code></pre></div>Second format:<div class="codebox"><p>Code: </p><pre><code>% set liveme "Janis Joplin-Piece Of My Heart"Janis Joplin-Piece Of My Heart% lsearch $liveme "-"-1% set liveme [join [split $liveme "-"] " - "]Janis Joplin - Piece Of My Heart% set pos [lsearch $liveme "-"]2% set liveme1 [lrange $liveme 0 [expr $pos - 1]]Janis Joplin% set liveme2 [lrange $liveme [expr $pos + 1] end]Piece Of My Heart</code></pre></div>And a code that accept both formats and gives the same result:<div class="codebox"><p>Code: </p><pre><code>set liveme "Janis Joplin-Piece Of My Heart"set pos [lsearch $liveme "-"]if {$pos == -1} {set liveme [join [split $liveme "-"] " - "]set pos [lsearch $liveme "-"]}set liveme1 [lrange $liveme 0 [expr $pos - 1]]set liveme2 [lrange $liveme [expr $pos + 1] end]</code></pre></div>Works regardless of the format, meaning with or without space.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Jun 22, 2017 12:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[silentziler]]></name></author>
		<updated>2017-06-21T18:37:26-04:00</updated>

		<published>2017-06-21T18:37:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106337#p106337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106337#p106337"/>
		<title type="html"><![CDATA[Re: Remove a concrete blank character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106337#p106337"><![CDATA[
Alternative:<br><br>regsub -all { &lt;} $liveme1 {&lt;} liveme1<br>regsub -all {&gt; } $liveme2 {&gt;} liveme2<br><br>instead of using [string map]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12563">silentziler</a> — Wed Jun 21, 2017 6:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2017-06-13T11:49:02-04:00</updated>

		<published>2017-06-13T11:49:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106310#p106310</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106310#p106310"/>
		<title type="html"><![CDATA[Remove a concrete blank character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106310#p106310"><![CDATA[
I have a variable that stores the artist name and the song separated by a hyphen.<br>The variable can return this format: <span style="color:blue">Artist-Song</span> <br>or<br>this format: <span style="color:blue">Artist - Song</span><br><br>I have made this script that works only for one of the options.<br><br>Example: <div class="codebox"><p>Code: </p><pre><code>bind pub n|n !t testingproc testing {nick uhost handle chan text} {set liveme "Janis Joplin-Piece Of My Heart" putquick "PRIVMSG $chan :\&lt;artistName\&gt;[lindex [split $liveme "-"] 0]\&lt;\/artistName\&gt;" putquick "PRIVMSG $chan :\&lt;songName\&gt;[lindex [split $liveme "-"] 1]\&lt;\/songName\&gt;"  }</code></pre></div>Returns what I want:<blockquote class="uncited"><div>17:34             @mybot ¦ &lt;artistName&gt;Janis Joplin&lt;/artistName&gt;<br>17:34             @mybot ¦ &lt;songName&gt;Piece Of My Heart&lt;/songName&gt;</div></blockquote>But... <br>If the variable contains the other format, spaces are left after the artist name and before the song name.<br><br>Example2: <div class="codebox"><p>Code: </p><pre><code>bind pub n|n !t testingproc testing {nick uhost handle chan text} {set liveme "Janis Joplin - Piece Of My Heart" putquick "PRIVMSG $chan :\&lt;artistName\&gt;[lindex [split $liveme "-"] 0]\&lt;\/artistName\&gt;" putquick "PRIVMSG $chan :\&lt;songName\&gt;[lindex [split $liveme "-"] 1]\&lt;\/songName\&gt;"  }</code></pre></div>Return this I do NOT want:<blockquote class="uncited"><div>17:34             @mybot ¦ &lt;artistName&gt;Janis Joplin &lt;/artistName&gt;<br>17:34             @mybot ¦ &lt;songName&gt; Piece Of My Heart&lt;/songName&gt;</div></blockquote>I need the format to always be the same regardless of the value of the variable.<br>I need always to achieve this:<blockquote class="uncited"><div>&lt;artistName&gt;Janis Joplin&lt;/artistName&gt;<br>&lt;songName&gt;Piece Of My Heart&lt;/songName&gt;</div></blockquote><span style="font-size:150%;line-height:116%"><strong class="text-strong">EDIT:</strong></span> Fixed!<div class="codebox"><p>Code: </p><pre><code>bind pub n|n !t testingproc testing {nick uhost handle chan text} {set liveme ""Janis Joplin - Piece Of My Heart""set liveme1 "\&lt;artistName\&gt;[lindex [split $liveme "-"] 0]\&lt;\/artistName\&gt;"set liveme2 "\&lt;songName\&gt;[lindex [split $liveme "-"] 1]\&lt;\/songName\&gt;"set liveme1 [string map [list " &lt;/" "&lt;/"] $liveme1]set liveme2 [string map [list "&gt; " "&gt;"] $liveme2]    putmsg $chan "$liveme1"  putmsg $chan "$liveme2"  }</code></pre></div>If you know of any more abbreviated or better, please share it. <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=12499">juanamores</a> — Tue Jun 13, 2017 11:49 am</p><hr />
]]></content>
	</entry>
	</feed>
