I am new to PERL and I am not a regular programmer. I need help in trying to sum, and also find averages. I have data as shown below 0 4/2/2007 6:00:15 21615 62 2 2 4 1 4/2/2007 6:00:55 21655 60 2 2 4 2 4/2/2007 6:01:15 21675 65 20 3 4 3 4/2/2007 6:02:15 21735 65 20 3 4 4 4/3/2007 6:00:00 21600 65 20 3 4 5 4/3/2007 6:00:15 21615 62 2 2 4 6 4/3/2007 6:00:55 21655 60 2 2 4 7 4/3/2007 6:02:15 21735 65 20 3 4 Cols 2, 3, and 4 are Date, time (in hours) and time (in seconds. The result I want is the sum (col 6) and average (cols 5 and 7) for 2 minute intervals by day. The result should look like ... 0 4/2/2007 6:00:00 62.33 8 2.33 1 4/2/2007 6:02:15 65 20 3 2 4/3/2007 6:00:00 62.33 8 2.33 3 4/3/2007 6:02:15 65 20 3 Thanks in advance to anyone who can help me with this...

In reply to Summing Lines by Bavie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.