complex parse question

complex parse question

am 26.07.2005 14:39:16 von Nex_s

Hi All,

Perhaps this is easier than I think but I need to parse a text file
and save it back to a text file. Description below:

I need the top portion or file header up to the word "ANNOVFL"
For each of the follow records I need to look for anything with a title
that starts with "NSP" and capture it's relevent data. For example:

38 NSPOWERANN1
30
0 0

Any help would be greatly appreciated.
Chris

#----------------- DATA --------------------------

BISH OMPR225 JUL20 13:25:28 0001 INFO OM REPORT
CLASS: NSPI
START:2005/07/20 13:20:00 WED; STOP: 2005/07/20 13:25:00 WED;
SLOWSAMPLES: 3 ; FASTSAMPLES: 30 ;

TRK
KEY (COMMON_LANGUAGE_NAME)
INFO (OM2TRKINFO)
NATTMPT NOVFLATB CONNECT

724 EMERAPRI2W
2W 94 94
23 0 23

------------------------------------------------------------ ------
6401 76 6302

ANN
KEY (COMMON_LANGUAGE_NAME)
INFO (ANN_OMINFO)
ANNATT ANNOVFL

37 NSCCADMQTA
100
0 0

38 NSPOWERANN1
30
0 0

39 DSCWIDRMDR
30
0 0

40 UCDQTA
200
19 0

41 UCDNSA
15
1 0

268 NSPCALANN23
255
0 0

269 NSPCHEANN24
255
0 0

270 NSPLIVANN25
255
0 0

271 NSPKINANN26
255
0 0