I need to split up a large document according to a style that it finds, then save that portion of the document into a new file with the with actual text of the style that it found as the name of the file. I have include an example to help what I mean.
********* Large document ***********
HEADING 1
this is some text in the first part of the document
HEADING 2
this is some text in the second part of the document
HEADING 2
this is some text in the third part of the document
********* End of Large document ***********
The above needs to end up as follows
********* Document 1 ***********
HEADING 1
this is some text in the first part of the document
********* Document 2 ***********
HEADING 2
this is some text in the second part of the document
********* Document 3 ***********
HEADING 2
this is some text in the third part of the document
Sorry its a bit of a tongue twister to explain what I mean
********* Large document ***********
HEADING 1
this is some text in the first part of the document
HEADING 2
this is some text in the second part of the document
HEADING 2
this is some text in the third part of the document
********* End of Large document ***********
The above needs to end up as follows
********* Document 1 ***********
HEADING 1
this is some text in the first part of the document
********* Document 2 ***********
HEADING 2
this is some text in the second part of the document
********* Document 3 ***********
HEADING 2
this is some text in the third part of the document
Sorry its a bit of a tongue twister to explain what I mean