in reply to Structure number
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"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Structure number
by AG87 (Acolyte) on Dec 02, 2010 at 05:51 UTC | |
by AG87 (Acolyte) on Dec 02, 2010 at 07:23 UTC | |
by jwkrahn (Abbot) on Dec 02, 2010 at 08:30 UTC | |
by AG87 (Acolyte) on Dec 02, 2010 at 09:02 UTC | |
by AG87 (Acolyte) on Dec 02, 2010 at 09:25 UTC | |
|