Hey everyone,
I have a file that looks like:
[record_1]
here=20
is=20
some
text
[record_2]
and=20
some
more
[record_3]
...
What I am trying to do is open the file and print all the lines in =
between particular record sets. However, my pattern matching skills =
are not what they ought to be
because I cannot get this to work.
If I want to print all the text in between [record_one] and =
[record_two], how do I do this?
Here is a sample of my code:
open (FILE, "$file") or die "Cannot open $file: $!\n";
while (<FILE>)
{
my $line = @_;
# We know which record to start at, and want to
# grab all the text until the next record
if (/^[record_one]/ .. /^[+[A-Za-z]+]/)
{
print "$line\n";
}
}
close FILE;
I am a Perl novice, so don't laugh too hard when you look at my code...
Thanks in advance for your help!
-Erich-
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs