1. i`m a newbie in tcl coding ...

2. my englisch is very very bad.. so ..

3. i spent a lot of time to do a script, that search a specific word in a text file and post specific lines from the text file...
the text file looks like:
line1
line2
line3
line4
line1
line2
line3
line4
the lines are full sentences ....
so.. my problem is that the script that i found it in this forum post me all, and i need that the script post me, from the first line to the last line (line1 to line4), if the specific word is in line1 or line2 or line3 or line4
the script what i use is a script coded by IsP ..
Code: Select all
proc rlslocate {nick uhost handle type arg} {
global rlsmaxsearch cd_release rlsinfo
if {$arg == ""} {puthelp "$type $nick :Syntax: $cmdsearch <search string>" ;return 0}
regsub -all -- " " ${arg} "*" rlsarg
puthelp "$type $nick : $rlsinfo ...Searching for '$rlsarg'"
set totrlsfound 0
foreach database $cd_release {
set rlsfile [open $database r]
while {![eof $rlsfile]} {
set rlsline [gets $rlsfile]
if {[string match "*$rlsarg*" [string tolower $rlsline]]} {
incr totrlsfound 1
if {$totrlsfound < $rlsmaxsearch} {
puthelp "$type $nick : \002Found:\002 $rlsline"
}
}
}
close $rlsfile
}
.
.
.
thx @ ll for help

PS: my own script it doesen`t work like IsP script ..so its much easier to take this script ... i think so
