I think I failed to explain my problem. The task is I have two log files (x.log and y.log) I have to search through them line by line and have to compare only those lines which contains a string ("mti_clk_chk") in between.

lets take an example

If my data set is like this.

LOG 1 (x.log) contains

INFO @1102266 PHResourceLayer_Z4: mti_clk_chk:################ start of test ################ ; T=1102266

INFO @1102334 PHResourceLayer_Z4: mti_clk_chk:Checking the period of MTI, MTI10 clk from SV; T=1102334


LOG 2 (y.log) contains

UVM_INFO @1092507 reporter Z4_COREA: mti_clk_chk: ################ start of test ################ ; T=1092507

UVM_INFO @1092563 reporter Z4_COREA: mti_clk_chk: Checking the period of MTI, MTI10 clk from SV; T=1092563


Then for first line I have to check "################ start of test ################ ; T=1102266" and "################ start of test ################ ; T=1092507" as value of T are not same so it should give these details in output file stating the details are not matching.

Similiarly for line 2 we have to match "Checking the period of MTI, MTI10 clk from SV; T=1102334" and "Checking the period of MTI, MTI10 clk from SV; T=1092563". Here also values of T are not matching so pass it to output file.

(For each line in the logs, every details after "mti_clk_chk:" needs to be checked )


In reply to Re^2: Compare two log files line by line containing a keyword by rahu_6697
in thread Compare two log files line by line containing a keyword by rahu_6697

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.