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

	<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-06-17T22:13:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-06-17T22:13:06-04:00</updated>

		<published>2006-06-17T22:13:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64126#p64126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64126#p64126"/>
		<title type="html"><![CDATA[Deleting several lines from a textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64126#p64126"><![CDATA[
so you are somehow reluctant to actually check out [lreplace] docs and see if it's able to delete more than one line?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sat Jun 17, 2006 10:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-06-17T06:17:45-04:00</updated>

		<published>2006-06-17T06:17:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64118#p64118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64118#p64118"/>
		<title type="html"><![CDATA[Deleting several lines from a textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64118#p64118"><![CDATA[
I know how to delete one line. On this forum there is a tutorial for it:<div class="codebox"><p>Code: </p><pre><code># Use the code from above (1.) to read in all the lines from the file.# We continue right after: set lines [split $data "\n"]# We'll delete the first line.set line_to_delete 0# If you wanted to delete the last line instead, you would do this:# set line_to_delete [expr [llength $lines] - 1]# Now, we remove the line from the list in memory first.set lines [lreplace $lines $line_to_delete $line_to_delete]# And finally, we re-write the file with the new data.set fp [open $fp "w"]puts $fp [join $lines "\n"]close $fp </code></pre></div>But here only one line is deleted. What do I have to change that all lines from the second till the end are deleted.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sat Jun 17, 2006 6:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-06-16T23:29:40-04:00</updated>

		<published>2006-06-16T23:29:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64112#p64112</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64112#p64112"/>
		<title type="html"><![CDATA[Deleting several lines from a textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64112#p64112"><![CDATA[
after so many requests for help, you should have known by now that any manipulation of text files is best done in memory - that is, you read the entire file into a list, manipulate the list, and write it back to disk file<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Fri Jun 16, 2006 11:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-06-16T17:55:25-04:00</updated>

		<published>2006-06-16T17:55:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64107#p64107</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64107#p64107"/>
		<title type="html"><![CDATA[Deleting several lines from a textfile]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64107#p64107"><![CDATA[
Hello!<br>I made a script but now I can't get on because I don't know how to delete all lines except for the first. That means I need a code that deletes all lines from the second till the end. Can anybody help me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Fri Jun 16, 2006 5:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
