perlnewbie9292 has asked for the wisdom of the Perl Monks concerning the following question:
SAMPLE FILEfor ( $linesFromFile ) { if ( /^StartTr1/gm .. /^oflTr1/gm ) { print; } }
RESULTS DESIREDStartTr1 sample 1 sample 1 sample 1 sample 1 SAMPLE 1 oflTr1 nothing nothing nothing StartTr1 sample 2 sample 2 sample 2 sample 2 sample 2 last line before sample 2 oflTr1 junk junk junk
sample 1 sample 1 sample 1 sample 1 SAMPLE 1 sample 2 sample 2 sample 2 sample 2 sample 2 last line before sample 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print all lines between to keywords
by AnomalousMonk (Archbishop) on Nov 09, 2009 at 22:03 UTC | |
|
Re: Print all lines between two keywords
by toolic (Bishop) on Nov 09, 2009 at 20:22 UTC |