[Orca-users] Re: Date_parse routine usage
Blair Zajac
blair at orcaware.com
Tue Sep 25 13:33:15 PDT 2001
Michael,
It should look something like this:
date_parse sub {
my $string = $_[0];
$string =~ s/_/ /g;
return parsedate($string);
}
The date_parse routine should be called for each line.
To debug this, try
date_parse sub {
my $string = $_[0];
$string =~ s/_/ /g;
my $t = parsedate($string);
print "$_[0] => $t => ', scalar localtime($t), "\n";
}
Blair
Mike Shannon wrote:
>
> I would like to use the date_parse routine now available in 0.27b1
>
> I have a few questions about how to include do it though
>
> my data file has information like this
>
> 12-Sep-2001_00:00:10 20 5
> 12-Sep-2001_00:00:20 20 4
> 12-Sep-2001_00:00:30 20 3
> 12-Sep-2001_00:00:40 20 3
> 12-Sep-2001_00:00:50 20 3
> 12-Sep-2001_00:01:00 20 1
> 12-Sep-2001_00:01:10 20 1
> 12-Sep-2001_00:01:20 20 2
> 12-Sep-2001_00:01:30 20 2
> 12-Sep-2001_00:01:40 20 2
>
> this is a snapshot of license usage data starting at midnight
> and captured every 10 seconds. the second column is the total
> number of licenses, the 3rd the total used at the time of the
> snapshot
>
> I'd like to plot this
>
> the date_parse routine, should allow me to restructure the
> fist column time stamp into epoch time
>
> but
>
> I don't know how to tell orca that I have a parse routine
> - what/where the routine is
>
> do I write the routine to be called - like in a sort loop -
> so it is called everytime, and it's job is to return the
> epoch time - 1 line at a time?
>
> any help with this would be greatly appreciated
>
> mike
More information about the Orca-users
mailing list