The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
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-30-2009
lalchand lalchand is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 4
Finding string and getting formatted ouput

I have follwoing text file as alarm dump.

Code:
A1/EXT "B25I11K0150_F W" 512 090629   1121      
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
MO                    RSITE            CLASS
RXOCF-405         DKRD01_INDS      1
EXTERNAL ALARM
MAINS FAIL                                                    
DOOR OPEN                                                     
H C T ON        

A1/EXT "B25I11K0150_F W" 523 090629   0627      
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
MO                    RSITE            CLASS
RXOCF-153         ACHL01_INDS      1
EXTERNAL ALARM
MAINS FAIL                                                    
BBU AC UNIT FAULTY                                            
BBU DOOR OPEN    
 
A1/EXT "B25I11K0150_F W" 299 090629   1710      
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
MO                    RSITE            CLASS
RXOCF-255         JHOT01_GIL       1
EXTERNAL ALARM
MAINS FAIL                                                    
DOOR OPEN
i need help for scripting to get below out put
1) Search " Mains Fail "

and give out put
Code:
JHOT01_GIL         090629   1710
ACHL01_INDS       090629   0627
DKRD01_INDS       090629   1121
in new file

Lal Chand

Last edited by Yogesh Sawant; 06-30-2009 at 06:04 AM.. Reason: added code tags