One of the problems I'm having is figuring out how to parse the data. Here's a snippet of the format it's in:
Title
CODE: II/Moderate
STATUS:
Description (centered up on the line)
blah blah blah
then it repeats the same format; from 'Title' to the text (blah blah).
Title
CODE: I/Unknown
STATUS:
Description (centered up on the line)
blah blah blah
What I need are all the CODE: I 's and nothing else. So it seems to me I need to:
- First find the text that matches CODE: I/ (as it doesn't always say moderate); to another file.
- Copy the one line above the matched string; to another file (Title).
- Then copy the line of the matched string, to another file.
- Copy everything until it finds text that matches CODE: I (terminator part of the parse), to another file.
- Then if I care about neatness I can go in and remove the last copied line... so I don't have Title there.. but meh that's a minor thing.
Now I'm sure people who have parsed things before are pulling their hair at my approach, but that's why I came here for help. I have multiple OS I can use, Redhat Linux being my main OS... but I'm willing to use Windows if need be.