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

	<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>2005-12-10T12:48:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ehlanna]]></name></author>
		<updated>2005-12-10T12:48:33-04:00</updated>

		<published>2005-12-10T12:48:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58146#p58146</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58146#p58146"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58146#p58146"><![CDATA[
Oh, I agree, writing it in tcl would be far more fun - just thought I would offer an 'obvious' alternative.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6506">Ehlanna</a> — Sat Dec 10, 2005 12:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-12-10T12:18:12-04:00</updated>

		<published>2005-12-10T12:18:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58144#p58144</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58144#p58144"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58144#p58144"><![CDATA[
Doing this through [file] is better for the performance and why use [exec] when you can do it through Tcl?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Dec 10, 2005 12:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ehlanna]]></name></author>
		<updated>2005-12-10T05:37:28-04:00</updated>

		<published>2005-12-10T05:37:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58138#p58138</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58138#p58138"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58138#p58138"><![CDATA[
Just a very silly thought on this ... how about using the command to shell out and run an OS sommand - is it exec? - and invoking the diff command?  Why reinvent the wheel?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6506">Ehlanna</a> — Sat Dec 10, 2005 5:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-12-09T16:01:16-04:00</updated>

		<published>2005-12-09T16:01:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58120#p58120</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58120#p58120"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58120#p58120"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Yes you can use lsearch to search through the list, as for deleting check your permissions.</div></blockquote>Sorry but how check permisions  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed">   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"><br><br>For "lsearch" , Which is for you the fastest way ?<br><br>thx</div></blockquote>look at <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/file.htm#M8" class="postlink">file attributes</a> &amp; <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/file.htm#M26" class="postlink">file owned</a><br><br>tho i would just check there md5 against eachother.. if it doesn't match then i would go and compare.. and do all the rest .. ( if the files arn't big files.. ofcourse..)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Dec 09, 2005 4:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[romain]]></name></author>
		<updated>2005-12-09T14:34:26-04:00</updated>

		<published>2005-12-09T14:34:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58119#p58119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58119#p58119"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58119#p58119"><![CDATA[
<blockquote class="uncited"><div>Yes you can use lsearch to search through the list, as for deleting check your permissions.</div></blockquote>Sorry but how check permisions  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed">   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"><br><br>For "lsearch" , Which is for you the fastest way ?<br><br>thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6856">romain</a> — Fri Dec 09, 2005 2:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-12-09T13:58:59-04:00</updated>

		<published>2005-12-09T13:58:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58117#p58117</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58117#p58117"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58117#p58117"><![CDATA[
Yes you can use lsearch to search through the list, as for deleting check your permissions.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Dec 09, 2005 1:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[romain]]></name></author>
		<updated>2005-12-09T11:19:50-04:00</updated>

		<published>2005-12-09T11:19:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58111#p58111</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58111#p58111"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58111#p58111"><![CDATA[
Ok thx i try.<br><br>it's not possible to use "lsearch" for verifier the data?<br><br>And i have <div class="codebox"><p>Code: </p><pre><code>file delete -force -- scripts/file1.txt file rename -force -- scripts/file2.txt scripts/file1.txt</code></pre></div>[17:10] Tcl error [pub:aj]: error deleting "scripts/file1.txt": permission denied<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6856">romain</a> — Fri Dec 09, 2005 11:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-12-09T10:10:08-04:00</updated>

		<published>2005-12-09T10:10:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58109#p58109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58109#p58109"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58109#p58109"><![CDATA[
That would probably cause in lappending the same line several times into the list. Try this:<div class="codebox"><p>Code: </p><pre><code>foreach a [split [read [open $file1] \n] {  set f 0 foreach b [split [read [open $file2] \n] {   if {[string equal $a $b]} {    # Found it, so we set f to 1 and we break this 2nd loop   set f 1   break  } } # if f is still 0, then there's no match and we add $a to the list if {!$f} { lappend c $a }}</code></pre></div>And don't forget to close the files after finishing from them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Dec 09, 2005 10:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[romain]]></name></author>
		<updated>2005-12-09T08:33:55-04:00</updated>

		<published>2005-12-09T08:33:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58106#p58106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58106#p58106"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58106#p58106"><![CDATA[
Yes but,<br><br>with <br><br> <div class="codebox"><p>Code: </p><pre><code>  foreach a [split [read [open $file1] \n] {    foreach b [split [read [open $file2] \n] {     if [string equal $a $b] {       continue     } else {       lappend c $a     }    }   }</code></pre></div>Don't works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_question.gif" width="15" height="15" alt=":?:" title="Question"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6856">romain</a> — Fri Dec 09, 2005 8:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-12-09T07:04:07-04:00</updated>

		<published>2005-12-09T07:04:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58101#p58101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58101#p58101"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58101#p58101"><![CDATA[
You can take the line from file1 and check if it exists in file2, if not then write it to the file and repeat that on each line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Dec 09, 2005 7:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[romain]]></name></author>
		<updated>2005-12-09T04:58:55-04:00</updated>

		<published>2005-12-09T04:58:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58097#p58097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58097#p58097"/>
		<title type="html"><![CDATA[compare two files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58097#p58097"><![CDATA[
hello,<br><br>I've 2 files(file1,file2),have the same number of lines,30 lines max.I want to write  data which are in the file1 but which is not in the file2.I try use foreach 2 time but I've many difficulties to write these data.Can you help me in the realization of this script?Thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6856">romain</a> — Fri Dec 09, 2005 4:58 am</p><hr />
]]></content>
	</entry>
	</feed>
