in reply to printing needed info only
my ($output,$match_flag); open (DATA, "/export/home/webadm/scripts/backup_scripts/backup_data/1s +tnodupe"); while (<DATA>) { if (/^Switch name complete/) { # match this $output .= $_; $match_flag=1; } elsif (/^\s/ && $match_flag) { # if correct, match this as well $output .= $_; } elsif (/^\S/) { # invalid, so don't match, or match following lines # beginning with whitespace $match_flag=0; } } close(DATA); print $output;
That strips out only the sections beginning with 'Switch name complete'. (Note, I didn't test, but I think syntax is OK).
cLive ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: printing needed info only
by Er1kW (Initiate) on May 03, 2001 at 22:51 UTC |