I have a file that contains a story. I need to split the file in a way that each chapter (chapter starts with the word 'chapter') will be in diffrent directory.
CHAPTER count as- everything that appears after the word 'CHAPTER' (like that). so every time that this word appears evertything after that till the next 'chapter' needs to move to new directory. I need to create the directories, they don't exist.
here is an example:
CHAPTER XII. Alice’s Evidence ‘Here!’ cried Alice, quite forgetting in the flurry of the moment how great emphasis, looking hard at Alice as he said do. CHAPTER VI. Pig and Pepper CHAPTER VII. A Mad Tea-Party CHAPTER VIII. The Queen’s Croquet-Ground CHAPTER IX. The Mock Turtle’s Story
There is no other way that the word 'CHAPTER' appears in the text