Aha! I get it. So essentially when a paragraph is found that contains '^From:' it places a marker at the beginning of that paragraph?
I could not figure out how it was handling all the blank lines within the e-mails until I realized that it wasn't and didn't need to.
Just to be clear, in order to actually subset the file I would still need to close and reopen it, right? I'm thinking something like:
open (<MYDATA>, $filein); while (<MYDATA>) { if (/^---- Email 1/ ... /---- Email2/) { open (<MYOUTPUT>, ">$fileout"); print MYOUTPUT $_; close (MYOUTPUT); } } close (MYDATA);
I suppose I might create a loop so that a new value for the search terms (i.e., /^---- Email 2/ ... /^---- Email 3/ for the second iteration, etc.) is selected as well as a new output file to catch the results...
In reply to Re^4: Subsetting text files containing e-mails
by PeterCap
in thread Subsetting text files containing e-mails
by PeterCap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |