Hi Monks! I am extremely new to Perl; and need to write a script to automate following: This is my input:
Column1 Column2 Column3 2870 S11 1 574 S11 2 317 S11 3 31 S11 4 1 S11 6 1 S11 7 2925 S12 1 8 S12 5 1 S12 6 1 S12 9
I am trying to write a perl script that prints out the lowest and highest values of Column3. But since S12 has value 1 appear more often than S11 in column3 based on the value in column1, I need the script to give me as a result the line of S12 as the lowest column3 value (2925 S12 1 ). Is there an easy way to do this? Please keep the script as simple as possible so that I can actually follow what you are doing and learn from it. Thanks for your help!

In reply to max and min values in 3-column file by perldummie

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.