Hello every one, I ma facing a problem with this file

position: 1 neighbors: 5

xxxx A 1 G L -135.185 178.150 179.885 0.000 0.000 0.0 +00 1 0.000 P 1 F 1 xxxx A 2 S L -49.668 -31.158 177.985 0.000 0.000 0.0 +00 1 0.000 P 1 F 1 xxxx A 3 M L -84.632 -45.215 177.518 0.000 0.000 0.0 +00 1 0.000 P 1 F 1 xxxx A 1 G L -115.240 -69.349 -171.360 0.000 0.000 0.0 +00 1 0.000 P 1 F 2 xxxx A 2 S L -84.776 -143.809 173.303 0.000 0.000 0.0 +00 1 0.000 P 1 F 2 xxxx A 3 M L -50.674 158.544 177.747 0.000 0.000 0.0 +00 1 0.000 P 1 F 2 xxxx A 1 G L -106.682 126.232 177.885 0.000 0.000 0.0 +00 1 0.000 P 1 F 3 xxxx A 2 S L -20.124 24.502 -179.585 0.000 0.000 0.0 +00 1 0.000 P 1 F 3 xxxx A 3 M L -60.092 2.018 -178.549 0.000 0.000 0.0 +00 1 0.000 P 1 F 3 xxxx A 1 G L -115.172 -16.017 -179.179 0.000 0.000 0.0 +00 1 0.000 P 1 F 4 xxxx A 2 S L -143.860 148.913 -179.781 0.000 0.000 0.0 +00 1 0.000 P 1 F 4 xxxx A 3 M L -81.755 -23.354 -174.564 0.000 0.000 0.0 +00 1 0.000 P 1 F 4 xxxx A 1 G L -71.907 147.690 -178.617 0.000 0.000 0.0 +00 1 0.000 P 1 F 5 xxxx A 2 S L -81.417 52.986 179.983 0.000 0.000 0.0 +00 1 0.000 P 1 F 5 xxxx A 3 M L -83.126 -56.051 178.109 0.000 0.000 0.0 +00 1 0.000 P 1 F 5

I need to average the numeric values in column 6 and 7 (I did not count the spaces) such that I get three lines. Line 1 is the average of of the first

line of each of the five groups, line 2 is the average of the second line of each of the five groups and so one. please help me, I am new to Perl and I

have been struggling with this file for some time.

many thanks

2018-04-04 Athanasius added code tags


In reply to averaging a group of lines with numeric value in a text file by Anas

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.