in reply to How to generate files based on some special character?
You can probably adapt one of the solutions given in How do I split a file into parts from the Categorized Questions and Answers section.
In Section
Seekers of Perl Wisdom
in reply to How to generate files based on some special character?