in reply to Re: How to select specific lines from a file
in thread How to select specific lines from a file
while(<>) %HoA=(); next unless /^ATOM\b/; @split_atom_line=split(/\s+/, $_); $chain=$split_atom_line[4]; $position=$split_atom_line[5]; $Zcoordinate=$split_atom_line[8]; if (not exists $HoA{$chain} or $position < $HoA{$chain}[0]) { $HoA{$chain} = [$position, $Zcoordinate]; } for $key ( keys %HoA ) { print "$key: $HoA{$key}[0]\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to select specific lines from a file
by Anonymous Monk on Apr 29, 2014 at 17:54 UTC | |
by Anonymous Monk on Apr 29, 2014 at 17:59 UTC |