Separating a file by two tokens
Hello Linux Gurus:
I have an Open Office Document.
In this file, many times it has a "start token line" that starts with the word "MODEL", followed by a number of spaces, followed by a number (For example: MODEL 1, MODEL 2, MODEL 3, MODEL 4, MODEL 5, .....etc).
After each "start token line", there are many lines that end with an "end token line" that consists only of the word "ENDMDL".
I would like to parse the file so that it grabs all lines starting from (and including) the "start token line" and ending at (and including) the "end token line" into a new output file.
In other words, if I ran this on a file with 100 of these "start token line" and "end token line", I would like to produce 100 files.
Any suggestions would be appreciated! I have parsed a file, but not tried a double token approach before...