Hi all.
some help on these would be greatly appreciated....
ok, i have file, the content of which is more or less like below..
IDN25900
TOP PRIORITY FOR IMMEDIATE BROADCAST
SYDNEY SEVERE THUNDERSTORM WARNING
BUREAU OF METEOROLOGY
NEW SOUTH WALES REGIONAL OFFICE Issued at 1703 on Saturday the 1st of
September 2001
This warning affects people in the following Local Government Area:
Wyong
This warning is current from 5:05pm until 6pm.
Storms are currently located to northwest of Wyong and are moving towards
the southeast. Locations that may be affected in the next hour include the
Wyong and The Entrance
Large hailstones, damaging winds and very heavy rainfall are possible.
The STATE EMERGENCY SERVICE advises that as storms approach people should:
put vehicles under cover
move indoors away from windows
During and after the storm people should:
beware of fallen trees and power lines
keep away from creeks and drains as you may be swept away
The RTA recommends motorists switch their lights & wipers on & slow down in
the wet.
If your house is damaged contact the State Emergency Service on 132 500 for
emergency assistance. Do not use the telephone during the storm.
TV CRAWL: Severe Thunderstorm Warning current for the Wyong Local
Government Area
MEDIA PLEASE NOTE: This warning will be updated within the next hour. The
Bureau and SES would appreciate it being broadcast regularly during this
period.
Now, i need to abbreviate that to 160 characters, and my current script that does it, is "clunky". It grabs the whole file, and abbreviates/deletes words etc etc.
I figure the has to be a better way, and such though it would be easier to say, parse the file for ceratin keywords, such as
"SYDNEY SEVERE THUNDERSTORM WARNING","Issued at 1703" ,"Saturday the 1st of September 2001", "Local Government Area: Wyong
"
etc etc, and these keywords would be the basis of the abbreviation. and out put would look something like
NSW 1703 1/09/ Svr TS Warning for Wyong
How can i achieve this quickly and effeciently, presently the code i do have, doesn't do a great job, and is growing by the day...
any help on getting this fixed would be great, thnx
SiMmAh
edit: removed 2nd Q