in reply to [Solved]Need to extract a particular block of lines between two patterns
This works for the data sample you provided.#!/usr/bin/perl use strict; use warnings; while (<>) { next if 1 .. /^END$/; if (/^START$/ .. /^END$/) { next if /^START$/; last if /^END$/; print; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: [Solved]Need to extract a particular block of lines between two patterns
by chengchl (Acolyte) on Nov 11, 2017 at 01:38 UTC | |
by Cristoforo (Curate) on Nov 11, 2017 at 02:53 UTC |