in reply to get few lines from a file

perl -ne 'push @arr,$_ if m/^Status of the log/..undef}{print for @ar +r' Your-log-file-name.here
(ab)uses the flip-flop operator. See "Range operator" in http://perldoc.perl.org/perlop.html.

             When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren

Replies are listed 'Best First'.
Re^2: get few lines from a file
by agreen54 (Initiate) on Nov 11, 2013 at 20:29 UTC
    Hi,

    Thanks for the code. I need small modification. I need to remove that status of the log line and print rest of the lines below it

      It is against the spirit of this site to request someone to write code for you without any attempt on your part, because the main purpose is education, which usually requires effort on the part of the recipient.

      That said, here is some code that will do the job, but I'm hoping you will try to understand how it works, and if you have difficulty with that, please post specific questions explaining how much you have understood, and what part you have difficulty with.

      perl -ne 'push @arr,$_ if $x;$x||=m/^Status of the log/}{print for @a +rr' Your-file.name
      Note - the only reason the code contains a "push @arr" is because you originally requested the contents be placed in an array.

                   When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren