The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-07-2006
cnlhap cnlhap is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 1
Cool how to filter out some paragraphs in a file

Hi,

I am trying to filter out those paragraphs that contains 'CONNECT', 'alter system switch logfile'. That means say the input file is :

-------------------------------------------------------
Wed Jun 7 00:32:31 2006
ACTION : 'CONNECT'
CLIENT USER: prdadm
CLIENT TERMINAL:

Wed Jun 7 00:32:31 2006
ACTION : 'alter system switch logfile'
CLIENT USER: prdadm
CLIENT TERMINAL:


Wed Jun 7 00:32:31 2006
ACTION : 'CONNECT'
CLIENT USER: prdadm
CLIENT TERMINAL:

Wed Jun 7 00:32:42 2006
ACTION : 'ALTER DATABASE CLOSE NORMAL'
CLIENT USER: prdadm
CLIENT TERMINAL:
----------------------------------------------------------------

I would like the output file to be :

----------------------------------------------------------------
Wed Jun 7 00:32:42 2006
ACTION : 'ALTER DATABASE CLOSE NORMAL'
CLIENT USER: prdadm
CLIENT TERMINAL:
----------------------------------------------------------------

Do you have any script to perform this, thank you very much .