#!/usr/bin/perl use strict; my %records; while (<DATA>) { chomp; my @values = split( "_" ); next unless $values[2] eq 'max'; $records{ $values[0] } = $values[1] if ( $records{ $values[0] } > $values[1] || ! $records{ $values[0] } ); } print map { "$_ => $records{$_} \n" } keys %records; __DATA__ 111aaa222ccc324567fed54333221235_1.04 111aaa222ccc324567fed54333221235_1.05_max 111aaa222ccc324567fed54333221235_0.98_min 111aaa222ccc324567fed54333221235_1.02_max 111aaa222ccc324567fed54333221235_0.21 777aaa222ccc324567fed54333221235_1.04 777aaa222ccc324567fed54333221235_1.07_min 777aaa222ccc324567fed54333221235_1.04_max
In reply to Re: File sort and values in file name
by bichonfrise74
in thread File sort and values in file name
by natol44
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |