in reply to Re: printing needed info only
in thread printing needed info only

Thank you Guys for your assistnace

I figured our a pattern and used it

Line pattern as follows:
/^\S/ # at least one followed by /^\s/ # and there are two lines of this


The line I needed we just before the /^\s/ line.
I was able to follow this pattern and print the desired
info out to yet another file

the following script is what I used:
#!/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; }
Thank you again for your support
Erik