I have a large text file, containing up to 2300 sections. Each section begins, one line before, "PAGE 1" The page number is at very end of the line,
T5271-AX1 TITLE DATE SUB TITLE PAGE 1 LINE1 LINE2 T5271-AX1 TITLE PAGE 2 LINE3 LINE4 SUB TITLE PAGE 3 LINE5 T5271-BX1 DATE SUB TITLE PAGE 1 LINE1
The file up to 2300 sections and each section can have several hundred pages, but sections always has "PAGE 1" at the end of the line.
The name of the file is contained in the first string of 9-15 characters on the line above "PAGE 1"
I want to split the file at "PAGE 1" and used the 9-15 characters at the name of the output file.
In my example the end result would be two files:
I can easily locate the page number and the title, but I don't know how to split the file and output it into a new file, until the the the next occurance of "PAGE 1".
Any help would be appreciated