Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
First, please go over your message and format it properly as per the List of Perl Monks Approved HTML Tags - just like I did quoting you:
I want output.txt file in following format
  1. To add and take average of second column entry(time stamp in hh:mm:ss) in file p10.txt (eg Retrieve_generic_assembly_(CP) is coming three times. So add all 3 entry and take average).
    Similarly do it for p20.txt.
  2. Write a new file output.txt that should have entry for all first column and avg entry of file p10.txt in second column and avg entry of p20.txt in third column and take difference of second and third column in fourth column.
I want output.txt format like this in 4 column
Subsection P10 P20 Delta(p10-p20) Retrieve_generic_assembly_(CP) 00:01:25 00:01:26 -00:00:01 Retrieve_assembly_1_(CP) 00:01:35 00:00:45 00:00:50 Retrieve_assembly_2_(CP) 00:01:42 00:02:46 -00:01:04

I am trying to achieve it through following code.

Then, please reformat your code with proper indenting, and insert comments telling yourself (and then us) at which place you are expecting to achieve what. For instance, I cannot see average calculus anywhere, not even an attempt thereof.

Hold on, you might get better answers, and nicer ones.

In reply to Re: Add same columns of a file and then compare two file contents by shmem
in thread [untitled node, ID 1007488] by amit1mtr

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (10)
    As of 2018-03-17 13:35 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (224 votes). Check out past polls.