hi
I'm trying to pull a set line from a news txt file to msg the channel, but because the identifying line is [14], the script isn't detecting it...
bind pub - .cbsnews pub:readcbs
proc pub:readcbs { nick uhost handle channel arg } {
set cbs [open cbs.txt r]
set lines [split [read $cbs nonewline]]
close $cbs
set i [lsearch -glob $lines "$*\[14\]*"]
if {$i != -1} {
putserv "PRIVMSG $channel :[lindex $lines $i]"
}
}
is this right to detect the [14] bit? also, is it possible to ignore some text in the line? specifically the date...but leaving in the stock code [AA]
Here's the original line in the txt file:
10:47pm 06/02/03 [[14]AA] ALCOA TO SELL S.AMERICAN PET BIZ FOR $75 MLN
what I'm trying to be left with is:
10:47pm [AA] ALCOA TO SELL S.AMERICAN PET BIZ FOR $75 MLN
thanks for any help in advance!