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.

reading txt file 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:

reading txt file line

Post by NewzUK »

Hi

Have done a search in the forum and tried a few things but can't find/understand quite what I need.

I have a news txt file (news\mkw.txt) which lynx dumps every minute and I want to read the line which has /04 in it.

Here are 2 example lines of the raw line from the file:

9:03pm 01/29/04 NIKKEI DOWN 35.00 POINTS AT 10,744.44 BY MIDDAY BREAK

8:56pm 01/29/04 [[12]CAJ] NIKKO CITI THINKS CANON '04 ESTIMATES 'EASY TO ACHIEVE'

I'd like to send it to channel without the time and date in front, but display a time in USET 24 hour format like 20:56 (the bot sits in GMT timezone which is USET +5hrs)
A couple of other things is that if there's a ticker symbol at the start of the headline (the letters in the [ ]) I want to ignore the number that lynx assigns to it (normally anything from [7] through [15] - but if there's no ticker on the story, there is no number), also if the headline is the same as last time it read the file (ie not a new story) then for the bot not to send anything.

Would appreciate any help!
Thanks.
#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 »

ps. the lynx command I use is:

bind time - "* * * * *" put:getnews

proc put:getnews { min hour day month year } {
exec lynx -preparsed -dump -width=5000 http://www.url.com > news/mkw.txt
}
#Newsroom - Where News & Markets Connect
http://www.inewsroom.net
#Newsroom on irc.othernet.org
Locked