ok im a retard or summin cos i just cant get it to work

This is what im trying to do.. making a script to fully automate pisg for an eggy. (and b4 u mention the fact that its a windrop, i know, i know) :p
Addstats works just although i prob cud tidy it up a bit

#
set dir "C:/Windrop/test.txt"
bind pub m !Addstat pub_addstat
proc pub_addstat {nick host handle channel arg} {
global botnick dir
set chan [string trimleft $channel #]
set file [open $dir a+]
set info "
<channel=\"$channel\">
Logfile=\"c:\\windrop\\logs\\$chan.log\"
Format=\"eggdrop\"
Network=\"Quakenet\"
Maintainer=\"$botnick\"
OutputFile=\"$chan.php\"
PageHead =\"html.txt\"
</channel>"
puts $file $info
close $file
return 1
}
bind pub m !rmvstat pub_rmvstat
proc pub_rmvstat {nick host handle channel arg} {
global dir
set info "<channel=\"$channel\">"
set found 0
set file [open $dir a+]
while {![eof $file]} {
gets $file list
if {$list == $info} { set found 1 }
}
close $file
if {$found == 1} {
putserv "NOTICE $nick :Channel stats Removed for $channel"
} else {
putserv "NOTICE $nick :Removing Channel stats failed for $channel"
}}
#
^ that was my original attempt at finding a line and at least getting it to tell me it had found it :/ didnt work oh well after your advice i tried this ...
#
bind pub m !rmvstat pub_rmvstat
proc pub_rmvstat {nick host handle channel testes} {
global dir
set info "<channel=\"$channel\">"
set found 0
set file [open $dir a+]
set buffer [read $file]
set contents [split $buffer "\n"]
foreach line $contents {
if {$line != ""} {
if {$contents == $info} { set found 1 }
}
close $file
if {$found == 1} {
putserv "NOTICE $nick :Channel stats Removed for $channel"
} else {
putserv "NOTICE $nick :Removing Channel stats failed for $channel"
}}}
#
Surely i must be getting closer by now .. i hope ... although it still doesnt work :/
ive tried a few other different ways of doing it however i doubt it wud be appreciated if i pasteded pages upon pages of txt :/ plz help poor me :/