learningperl01 has asked for the wisdom of the Perl Monks concerning the following question:
The reason that I am looking for 1st occurrences of Subject followed by Content is that Content will sometimes show up in several places, but I only want to PRINT all data from the 1st Content: after the 1st Subject: match.
Below is some sample data which I would be working with, any pointers etc would be greatly appreciated.
Right now what I am doing is having to run matches on each line that I want to match and print on.
SAMPLE FILE DATA:
Sender: 123 Recipient: aaa Date: 2009/03/04 Content: data0039 Time: 08:20:01 Operator: test Subject: test01 Content: data data Subject: RE: test Content: data2 data Additional: additional data
OUTPUT THAT I'M TRYING TO GET
So I want to find the First Occurrence of Subject: following by the first occurrence of Content: and print everything prior to the Content: match.
Sender: 123 Recipient: aaa Date: 2009/03/04 Content: data0039 Time: 08:20:01 Operator: test Subject: test01
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print data after to 1st occurrence matches
by jwkrahn (Abbot) on Sep 23, 2009 at 14:12 UTC | |
|
Re: Print data after to 1st occurrence matches
by BioLion (Curate) on Sep 23, 2009 at 14:32 UTC |