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



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
More formatted string ford2020 Shell Programming and Scripting 3 05-14-2009 09:13 PM
finding lines only between a certain string aismann Shell Programming and Scripting 14 10-30-2008 05:38 AM
Convert DATE string to a formatted text osramos Shell Programming and Scripting 6 10-10-2007 06:31 AM
help with finding a string sandyg Shell Programming and Scripting 2 09-28-2007 11:15 AM
Finding part of a string DAFNIX Shell Programming and Scripting 4 09-21-2006 12:24 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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 07:04 AM.. Reason: added code tags
  #2 (permalink)  
Old 06-30-2009
palsevlohit_123 palsevlohit_123 is offline
Registered User
  
 

Join Date: Aug 2008
Location: India-Chennai
Posts: 120
Try the below...


Code:
cat temp.txt | egrep "A1/EXT|RXOCF" | paste - - | awk '{print $8,$5,$6}'
Note: temp.txt will be the input file.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0