i am NEW to tcl scripting, i am trying to create a script that users can search and delete items from a separate file containing the items, i have the searching part worked out, i am having trouble with the deleting of items. each item is on a separate line. is there anyway of deleting a line in tcl? Because currently i am overwriting the line and in a lot of cases this causes the next line to be messed up because i don't know how to overwrite the exact amount of characters in the line i want to kill. Could some one please see if they understand what im saying, and if you coul kick me in the right direction i would REALLY appreciate it.
cheers
<font size=-1>[ This Message was edited by: fizzik on 2002-06-15 01:29 ]</font>
We should make a little fileutil.tcl that has all these commonly used functions in them. People seem to ask several main questions:
how do I read a random line
how do I delete a line
how do I search for a line
how do I read all the lines into a list
how do I insert a line at the (beginning|end)
But I guess these are the same people who are too lazy to search for the answers that have already been given. They probably wouldn't bother getting the file.
thanks for the replies. stdragon, i have searched EXTENSIVELY looking for a answer but i obviously dont know what to search for, could you please give me a pointer on what to search for? thanks.