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

	<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-02-23T12:49:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-23T12:49:58-04:00</updated>

		<published>2009-02-23T12:49:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87528#p87528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87528#p87528"/>
		<title type="html"><![CDATA[how to remove duplicate names in the o/p file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87528#p87528"><![CDATA[
Or, actually, since you use lists and glob-style matching, this could probably be made alot simpler...<div class="codebox"><p>Code: </p><pre><code>set newdata [lsort -unique [lsearch -all -inline -glob $data "X*"]]#you do some data-mangling, so we'll do it here... I'm assuming each line is a valid tcl-list on it's ownforeach line $newdata { puts [lrange $line 1 4]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Feb 23, 2009 12:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-02-23T12:42:05-04:00</updated>

		<published>2009-02-23T12:42:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87527#p87527</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87527#p87527"/>
		<title type="html"><![CDATA[how to remove duplicate names in the o/p file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87527#p87527"><![CDATA[
I'd suggest you create a new, separate, list, and add desired rows there. This allows you to use lsearch to see whether the current data already exists within this list (if it does, just skip it).<br><br>One thing I noticed though; the code below is pretty pointless, as the list in $new will always contain one single list item (hence the loop will only run once).<div class="codebox"><p>Code: </p><pre><code>set new [list $line]foreach nets $new {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Feb 23, 2009 12:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pranjal_ccna961]]></name></author>
		<updated>2009-02-23T00:27:02-04:00</updated>

		<published>2009-02-23T00:27:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87519#p87519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87519#p87519"/>
		<title type="html"><![CDATA[how to remove duplicate names in the o/p file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87519#p87519"><![CDATA[
Hi,<br><br>I am giving a file (in) as input and sorting out the desired matched pattern in a different file(out).  Since I am getting the output in loop, I am unable to remove the duplicate item.<br><br>set in [open filename_1 r]<br>set data [read $in]<br>close $in<br>set data [split $data "\n"]<br>foreach line $data {<br>if {[string match "X*" $line] == 1} {<br>set new [list $line]<br>foreach nets $new {<br>set newnets [lrange $nets 1 4]<br>lsort -unique $newnets<br>puts $newnets<br>}<br><br>Can anyone help me in this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10504">pranjal_ccna961</a> — Mon Feb 23, 2009 12:27 am</p><hr />
]]></content>
	</entry>
	</feed>
