#!/usr/bin/perl
use strict;
use warnings;
while (<DATA>) {
next unless /^HW\/OS\/Client:/ .. /^$/;
next if /^$/;
print;
}
__DATA__
Greetings, New here. Just learning Perl too.
:-) I'm parsing through a test file. I need to
parse through the text file until I find HW/OS/Client
print that line and then print each subsequent line of
"clients" until the line read from the text file is blank.
The text section in this very large text file looks
HW/OS/Client: PC Windows2003 server1
PC Windows2003 server2
PC Windows2003 server3
PC Windows2003 server4
PC Windows2000 server5
PC Windows2000 server6
blah blah, blah
blah blah, blah
blah blah, blah
blah blah, blah
|