in reply to Re: (jeffa) Re: Parsing a Text File
in thread Parsing a Text File

Thanks for the help. I changed my code up and it is doing what I had intended, however, it is picking up the first line of DOUBLE PLAYS. Any suggestions would be appreaciated.
open(INPUT,"c:/MLB_boxscore.TXT") or die "Can't open file"; print "<html><head><title>My page</title></head><body>"; print "<table>"; $pitching = 0; while(<INPUT>) { if($pitching) { last if /^[A-Z]+$/; chomp; @LS = (); push @LS, split('\|',$_); print "<tr>"; print "<td>" . $LS[$_] . "</td>" for (1..$#LS); print "</tr>"; } elsif(/^PITCHING/) { $pitching = 1} } print "</table></body></html>"; close INPUT;

Replies are listed 'Best First'.
Re: Re: Re: (jeffa) Re: Parsing a Text File
by suaveant (Parson) on Apr 11, 2001 at 23:52 UTC
    ooops, sorry!
    last if /^[A-Z\s]+$/;
    that will allow all caps and whitespace only
                    - Ant