Hi mrityunjaynath,

When I run your code against this sample input, I get the output "the original quartus 9.1" and "the latest quartus 11.1" - so it would seem that the problem is happening elsewhere in your code.

To narrow down where the problem is occurring, sometimes the simplest thing to do is print debug output at strategic places in your code to monitor its progress, see also the Basic debugging checklist. Another option is stepping through your code with the debugger (tutorial).

Once you've narrowed down where your problem is occurring, boil down your code and sample input into a Short, Self Contained, Correct Example, that is, a piece of code that compiles and reproduces the problem, along with its sample input and the expected output vs. actual output including error messages (see also How do I post a question effectively?), and post it here.

Often this process will help you discover the bug and the fix too! :-)

Hope this helps,
-- Hauke D


In reply to Re^3: searching two pattern sequentially from one file by haukex
in thread searching two pattern sequentially from one file by mrityunjaynath

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.