in reply to reading a delimited file and selecting values from it

Ok , thanks for the input.. but the thing is i have a file for each half hour interval, with upto 10 seperate readings..

I have put this ugly looking thing together.. which does seem to work..

use strict; my $input = "quotes.txt"; my ($quote,$time); my $actualquote; my $actualtime; my $hour; my $minute; my $second; my $picksecond; open(DATAFILE, "$input") || die("Can't open $input:!\n"); $picksecond =1; while (<DATAFILE>) { chomp $_; ($quote,$time) = split(",", $_); ($hour,$minute,$second) = split(":",$time); if ($second==0) {$actualtime=$time; $actualquote=$quote;$picksecond=99;} if ($second>$picksecond) {$picksecond=$second;$actualtime=$time; $actualquote=$quote;} print "$quote\t$time\t$second\n"; } print "$picksecond\t$actualtime\t$actualquote\n";

Does anyone care to comment on my code..??

i have another outstanding issue..

when i have a messed up time field e.g 17:30:07fg

how do i get the split command to ignore any characters after the 2 seconds digit? thanks.

conal.