Gossamer Forum
Home : General : Perl Programming :

data formatting for a time period

Quote Reply
data formatting for a time period
A small database sorting subroutine, will sort and print the data:

foreach $rec (@ODB){
chomp($rec);
($ID,$job,$address,$date)=split(/\|/,$rec);
open(PAY,"$database.txt") ;
$payit = <PAY> ;
close(PAY);
print "<td><font size=2>$ID</font></td><td><font size=2>$job</font></td><td><font size=2>$address</font></td><td><font size=2>$date</font></td>\n";
}

Here is what database looks like:

239|job23|AZ|Apr-04-03
3033|job853|NY|Apr-05-03
23233|job99|TX|Apr-12-03

End of Database>>>>>>>>>

Now the problem is I want to sort/print this database by date

for example I just want to show the records from a particular date to a particular date like

from Apr-02-03 to Apr-14-03?

any method to sort the results for a particular time period?

Thanks,

Zeshan.