Updated, thanks CountZero.
use warnings; use atrict; open MYFILE, '<', $data_file or die "Could not open '$data_file' because $!"; my $energy; while ( <MYFILE> ) { if ( /\bENERGY\b/ ) { ++$energy; next; } my ( $key, @fields ) = grep $_, split; for my $field ( @fields ) { print "$key $field $energy\n"; } }
In reply to Re: Structure number
by jwkrahn
in thread Structure number
by AG87
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |