Ok, heres a tidied up version - thanks 'iamdeath' if {[file exists $searchfile]} { set filech [open $searchfile r] while {![eof $filech]} { gets $filech line set edline $line set strip [stripcodes bcruag $edline] if {[string match -nocase *$text* $edline] && [string match -nocase *#* $edline...