Hello, i have a text file with numbers arranged as groups seperated by blank(empty) lines such as -
_DATA_ 20.187 15.415 8.663 6.001 6.565 6.459 6.564 13.454 13.475 13.220 +12.982 13.502 13.774 13.490 19.715 14.726 8.307 5.833 6.367 6.089 6.444 6.403 8.672 8.236 +12.982 13.502 13.774 13.490 20.099 15.205 8.763 6.317 6.861 6.973 6.701 6.334 8.406 8.155 + 7.395 8.156 9.551 8.530
How can i add all the first elements (20.187+19.715+20.099 etc ) , second elements (15.415+14.726+15.205) and so on in the list.(Groups are always of equal length. thanks

In reply to adding array elements by Sidac

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.