in reply to Parsing a data file to find the highest value.
update: Changed the regex to match the data provided by the OP.
my $high_id = 0; open my $ID_FILE, "<", "path/to/file" or die $!; while ( <$ID_FILE> ) { my ( $id ) = m/:(\d+):/; # extract first number from line $high_id = $id if $id > $high_id; } print "highest id found = $high_id\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a data file to find the highest value.
by misconfiguration (Sexton) on Nov 30, 2007 at 19:06 UTC |