in reply to Re: get few lines from a file
in thread get few lines from a file

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

Replies are listed 'Best First'.
Re^3: get few lines from a file
by NetWallah (Canon) on Nov 12, 2013 at 06:05 UTC
    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