Sachin_dada has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: GREP or any other simpler way???
by Ratazong (Monsignor) on Oct 12, 2010 at 07:19 UTC

    It is not so hard! :-)

    You can read the file line-by-line and check each line if your keyword, a colon and a number are contained. This can be done by a pattern-matching using a regex. The tricky thing is to find a siutable regex. In your case I would start with:

    /Input\s+:\s+(\d+)/;
    If you have your line in a variable called $line, you could write
    if ($line =~ /Input\s+:\s+(\d+)/) { print $1," is the value of Input"; + }

    You can find further reading on Regular expressions/pattern-matching in this collection by planetscape.

    HTH, Rata
      Thats no Automation , whatever that is, that is regular perl :)
Re: GREP or any other simpler way???
by Corion (Patriarch) on Oct 12, 2010 at 07:17 UTC

    What code have you already written? Where do you have problems exactly? How does the code you have fail to do what you want?

    Please post a self-contained small script and some representative example input so we can reproduce your problems.

Re: GREP or any other simpler way???
by ww (Archbishop) on Oct 12, 2010 at 12:33 UTC
    Smells a lot like homework.

    For the code you requested, go to https://homework.{your preferred computer-language}.example.com. Be aware that that site is rarely on-line (I suspect it's DDOSed by lazy students).