set borra1 "</table>"
set modfile [open index.php "r"]
set todo [read -nonewline $modfile]
close $modfile
set lee [split $todo "\n"]
set lee [lreplace $lee $borra1 $borra1]
set modfile [open $modfile "w"]
puts $modfile [join $lee "\n"]
close $modfile
but error: bad index "</table>": must be integer or end?-integer?
set borra1 "</table>"
set modfile [open index.php "r"]
set todo [read -nonewline $modfile]
close $modfile
set lee [split $todo "\n"]
set lee [lreplace $borra1 1 2 $borra1]
set modfile [open $modfile "w"]
puts $modfile [join $lee "\n"]
close $modfile
error: Tcl error [encuesta]: list doesn't contain element 1
what I want is that in the file, borra1 is eliminated, is to say </table > since she is one of the part of the end of the file. thanks of all way
maybe change it to 0 end if its only one element cause, from what i understand is that the list doesn't contain more then 1 element .. so what is it that u wana replace ??