skytarget has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Is there anyway in PERL to result the person and the person count with respect to the time and date. Suppose from 11/12/2014 9:46 AM to 11/12/2014 10:03 AM, how many A or B or C occur in the following example:

Time Person 1 11/12/2014 9:46 A 2 11/12/2014 9:47 B 3 11/12/2014 9:48 A 4 11/12/2014 9:49 A 5 11/12/2014 9:50 A 6 11/12/2014 9:51 A 7 11/12/2014 9:52 B 8 11/12/2014 9:53 B 9 11/12/2014 9:54 B 10 11/12/2014 9:55 B 11 11/12/2014 9:56 B 12 11/12/2014 9:57 C 13 11/12/2014 9:58 C 14 11/12/2014 9:59 C 15 11/12/2014 10:00 A 16 11/12/2014 10:01 B 17 11/12/2014 10:02 C 18 11/12/2014 10:03 C

and the result I want should be the following:

Time Person Total_count 11/12/2014 9:46:18 AM to 11/12/2014 10:03:18 AM A 6 11/12/2014 9:46:18 AM to 11/12/2014 10:03:18 AM B 7 11/12/2014 9:46:18 AM to 11/12/2014 10:03:18 AM C 5

Replies are listed 'Best First'.
Re: searching items in a row based on time and date
by ww (Archbishop) on Dec 08, 2014 at 12:35 UTC
Re: searching items in a row based on time and date
by Laurent_R (Canon) on Dec 08, 2014 at 16:34 UTC
    Do you have the problem managing the dates or counting the number of occurence of each letter? Since your reecords appear to be sorted in the right date order, it should really not be difficult identifying the records you need look at and then extract data from them.
Re: searching items in a row based on time and date
by Anonymous Monk on Dec 08, 2014 at 13:13 UTC
    CREATE TABLE foobar ( Who CHAR(1), When DATETIME); ... INSERT INTO foobar ... INSERT INTO foobar ... ... SELECT Who, COUNT(DISTINCT who) FROM foobar GROUP BY who; ...
    Even a spreadsheet can do it.
Re: searching items in a row based on time and date
by karlgoethebier (Abbot) on Dec 09, 2014 at 17:26 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.