I have the following data file, which has been extracted from a log file in Tuxedo:
100644:MWTP_CAT:12002: SERVER:pid=14520:Execution time:TPR015-10:(mill +isec):53 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR015-10:(mill +isec):10 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR015-10:(mill +isec):33 100644:MWTP_CAT:12002: SERVER:pid=16565:Execution time:TPR007-12:(mill +isec):437 100644:MWTP_CAT:12002: SERVER:pid=16565:Execution time:TPR007-12:(mill +isec):470 100644:MWTP_CAT:12002: SERVER:pid=16048:Execution time:TPR009-30:(mill +isec):24 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR012-01E:(mil +lisec):63 100644:MWTP_CAT:12002: SERVER:pid=10427:Execution time:ISCST044:(milli +sec):0 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR012-01E:(mil +lisec):85 100644:MWTP_CAT:12002: SERVER:pid=10428:Execution time:01201E:(millise +c):3
I need to sort this data by the number of milliseconds (execution time), so the above would look like:
100644:MWTP_CAT:12002: SERVER:pid=16565:Execution time:TPR007-12:(mill +isec):470 100644:MWTP_CAT:12002: SERVER:pid=16565:Execution time:TPR007-12:(mill +isec):437 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR012-01E:(mil +lisec):85 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR012-01E:(mil +lisec):63 100644:MWTP_CAT:12002: SERVER:pid=14520:Execution time:TPR015-10:(mill +isec):53 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR015-10:(mill +isec):33 100644:MWTP_CAT:12002: SERVER:pid=16048:Execution time:TPR009-30:(mill +isec):24 100644:MWTP_CAT:12002: SERVER:pid=15866:Execution time:TPR015-10:(mill +isec):10 100644:MWTP_CAT:12002: SERVER:pid=10428:Execution time:01201E:(millise +c):3 100644:MWTP_CAT:12002: SERVER:pid=10427:Execution time:ISCST044:(milli +sec):0
I know that the sort feature I need specifically would be sort { $a cmp $b } but I am unsure as to how I would extract and sort. As always, just give pointers in the right direction. Thanks.

TStanley
--------
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell

In reply to Sorting records on a single field by TStanley

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.