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

	<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>2006-11-09T06:12:45-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-09T06:12:45-04:00</updated>

		<published>2006-11-09T06:12:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67843#p67843</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67843#p67843"/>
		<title type="html"><![CDATA[Change line in a text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67843#p67843"><![CDATA[
This proc written by user might help you:<div class="codebox"><p>Code: </p><pre><code># Replace one or more lines # Usage: replaceLines &lt;file&gt; &lt;first line&gt; &lt;last line&gt; [replacement data (optional)] # Accepts the same values for indexes as 'lreplace' (check your manual) proc replaceLines {args} {    if {[llength $args]&gt;=3} {       foreach {file start end} $args break       set cmd [list lreplace [split [read [set f [open $file r]]] \n] $start $end]       close $f       if {[llength $args]&gt;3} {lappend cmd [lindex $args 3]}       puts -nonewline [set f [open $file w]] [join [eval $cmd] \n]       close $f    } {       error "wrong # args: should be \"[lindex [info level 0] 0] file start end ?replacement?\""    } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Nov 09, 2006 6:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[joke]]></name></author>
		<updated>2006-11-09T03:34:37-04:00</updated>

		<published>2006-11-09T03:34:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67841#p67841</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67841#p67841"/>
		<title type="html"><![CDATA[Change line in a text file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67841#p67841"><![CDATA[
Hi,<br><br>I've got a text file with many (let's say 1000) lines. The bot should find a certain line (by string match) and replace it with a new one.<br><br>I tried to set up a list (each line in the text file represents a list item) and tried to let the bot go through (and replayce the item). So far it worked but I need to change more than 1 line - in fact something about 50 lines. This seems to be a problem (bot crashes), perhaps because my way with this huge list needs too many ressources.<br><br>Anyone knows how to make this operation quicker and easier for the bot and can post the code for it?<br><br>Thanks a lot.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6616">joke</a> — Thu Nov 09, 2006 3:34 am</p><hr />
]]></content>
	</entry>
	</feed>
