in reply to Re: printing needed info only
in thread printing needed info only
/^\S/ # at least one followed by /^\s/ # and there are two lines of this
Thank you again for your support#!/usr/bin/perl -w use strict; my $previous_line = ""; my $line = ""; open (DATA, "/export/home/webadm/scripts/data/fourth_parse"); while (<DATA>) { chop; $line = $_; if ($line =~ /^\s/ && $previous_line =~ /^\S/) { print "$previous_line\n"; } else { if ($line =~ /^\sR*/ && $previous_line =~ /^\sR*/) { print "$previous_line\n"; print "$line\n"; } } $previous_line = $line; }
|
|---|