Need help with a script for a project
I have to write a perl script for a project I am working on and I am kind of stuck, so I would appreciate any feedback. I am working with an epistolary novel (a novel that consists of a bunch of letters written by different characters) and I am supposed to separate out the letters by each character so that I end up with a bunch of files, each containing all of the letters from a particular character. So I want to separate all of the letters written by a character named Anna Howe, and I noticed that her letters begin with either Jan., Febr., or March and then a date, and her letters end with <p class="left">ANNA HOWE, and usually there is something in between the p class-"left" and her name, such as yours truly or your sister. So, I am trying to match the beginning of the letter and the ending of the letter using regular expressions, and then somehow telling the script to output the content in between those two patterns to a file named "Anna". This is the script that I wrote, but it doesn't work:
Re: Need help with a script for a project
One approach would be to do a split on the string that has all the letters using her signature (ANNA HOWE) - that would break it into chunks, with a letter of hers at the end of each. Then process each chunk, looking for the date string that begins each letter and grabbing everything (using the 's' modifier) to the end each chunk.
|All times are GMT +5.5. The time now is 14:35.|