This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

selecting a line

Old posts that have not been replied to for several years.
Locked
N
NewzUK
Master
Posts: 200
Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:

selecting a line

Post by NewzUK »

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!
#Newsroom - Where News & Markets Connect
http://www.inewsroom.net
#Newsroom on irc.othernet.org
N
NewzUK
Master
Posts: 200
Joined: Mon Nov 18, 2002 3:10 am
Location: Auckland, New Zealand
Contact:

Post by NewzUK »

p.s. - I'm also trying to get it so it dosn't repeat if the line of news hasn't changed since the last time it checked!
#Newsroom - Where News & Markets Connect
http://www.inewsroom.net
#Newsroom on irc.othernet.org
Locked