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-24-2009
shaliniyadav shaliniyadav is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 30
Thumbs up Script on pattern matching and print lines and export to excel

Hi Friends,

I am working on a script.. Looking forward for your expert help.....

My requirement is:

I have a text file where, need to search equip * RTF or end of line with RTF ,once this pattern is found then print 2nd line, 6th line, 7th line to a different file.
For Ex:

Code:
equip 1 RTF
FULL
BCCH
2 0
0
4 0 4 6 9 106 1353
75
255 255 255 255 255 255 255 255
5 5 5 5 5 5 5 5
0
2
0
0
3
3
0
equip 2 RTF
FULL
NON_BCCH
0 1
0
4 0 4 6 9 106 1351
80
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
0
0
2
1
0
1
0
OutPut will be
Code:
BCCH 4 0 4 6 9 106 1353 75
NON_BCCH 4 0 4 6 9 106 1351 80
so on.. Thr wil be many lines matching equip 1 RTF...

Regards
Shalini

Last edited by Yogesh Sawant; 06-29-2009 at 05:48 AM.. Reason: added code tags