Need awk/sed command to pull out matching lines from a block

Hi,

In order to make our debugging easier in log files, I need this script.
My log file will be structured like this :

------Invoking myfile -param:start_time=1371150900000 -param:end_time=1371151800000 for 06/14/2013

<multiple lines here>
.....

  • Step Sybase CDR Table.0 ended successfully, processed 10 lines

----------Invoking myfile -param:cmr_table=cmr_table_L_20130614 -param:start_time=1371151800000 -param:end_time=1371152700000 for 06/14/2013

As you see, Invoking line gets added everytime my process is run.
I want to have a script that adds the following lines :
------Invoking myfile -param:start_time=1371150900000 -param:end_time=1371151800000 for 06/14/2013

  • Step Sybase CDR Table.0 ended successfully, processed 10 lines
    ----------Invoking myfile -param:cmr_table=cmr_table_L_20130614 -param:start_time=1371151800000 -param:end_time=1371152700000 for 06/14/2013
    • Step Sybase CDR Table.0 ended successfully, processed 30 lines.

How do I do it ?

Thanks in Advance.

Since you didn't provide much clue :
I assume this coud be a start :

awk '/Invoking/||/Sybase CDR Table/' yourlogfile

Thanks, That solved my problem.:slight_smile:

Can be shorten some

awk '/Invoking|Sybase CDR Table/' yourlogfile