Hi.... I am new to perl.... and after reading up on how to write scripts. I find I am not able to do this simple thing. I can do it in Excel but I would like a script in perl to do the same thing. Here's the details I have a file....... date:col1:col2:col3 20010102:21:45:25 20010103:14:20:15 etc......... 20010124:10:8:10 What I would like to do is find the 10 day average of col3 and the 5 day average of col2...... and write all of this to a log file......like this... "Name of file" average col2 value of last entry col2 average col3 value of last entry of col3 ( last entry is the last line in the file ie 20010124.. Could someone please have a look at this and help me out here...??? Thank you Joachim

In reply to BASIC MATH WITH DATA by joachim

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.