I have numerous files that looks similiar to this:
WHlog.20050904:{/208} {10}, {STATS}, {2005-09-04/10:05:58}, {Work}, { +I}, {PutQueue} "SVC(3/370)"~"Queue1"~ PUT to WHlog.20050904:{/208} {12}, {STATS}, {2005-09-04/10:05:58}, {Work}, { +I}, {PutQueue} "SVC(3/360)"~"Queue2"~ PUT to WHlog.20050904:{/208} {8}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I +}, {PutQueue} "SVC(3/332)"~"Queue3"~ PUT to WHlog.20050904:{/208} {11}, {STATS}, {2005-09-04/10:05:59}, {Work}, { +I}, {PutQueue} "SVC(3/347)"~"Queue4"~ PUT to WHlog.20050904:{/208} {6}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I +}, {PutQueue} "SVC(3/366)"~"Queue5"~ PUT to WHlog.20050904:{/208} {11}, {STATS}, {2005-09-04/10:05:59}, {Work}, { +I}, {PutQueue} "SVC(3/323)"~"Queue6"~ PUT to WHlog.20050904:{/208} {3}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I +}, {PutQueue} "SVC(3/339)"~"Queue7"~ PUT to WHlog.20050904:{/208} {6}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I +}, {PutQueue} "SVC(3/354)"~"Queue8"~ PUT to WHlog.20050904:{/3} {7}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I}, + {GetQueue} "SVC"~"Queue1-WFR"~ token=2879, WHlog.20050904:{/3} {10}, {STATS}, {2005-09-04/10:05:59}, {Work}, {I} +, {GetQueue} "SVC"~"Queue2-WFR"~ token=2893 WHlog.20050904:{/3} {4}, {STATS}, {2005-09-04/10:06:00}, {Work}, {I}, + {GetQueue} "SVC"~"Queue3-WFR"~ token=2249,
The problem i have is i want to get Queue# time and Queue#-wfr time and show the difference between the two EX: Queue5 time= 10:05:59 and Queue3-WFR time is 10:06:00 the difference is 1 second. Their is no pattern to this for example one time it could be queue4 next time it could be queue5.

CODE tags added by Arunbear

2005-09-08 Retitled by g0n, as per Monastery guidelines
Original title: 'time'


In reply to extracting timestamps from logfile by celliott

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.