![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Split a paragraph | Sekar1 | UNIX for Dummies Questions & Answers | 3 | 06-05-2008 12:35 PM |
| Extract a paragraph | capri_drm | Linux | 2 | 06-04-2008 03:01 PM |
| script for a 3 line paragraph | invinzin21 | Shell Programming and Scripting | 2 | 12-18-2007 01:11 AM |
| selecting each paragraph and put it into a file...help me | swamymns | Shell Programming and Scripting | 2 | 10-04-2005 11:46 AM |
| Bold the paragraph | caprikar | Shell Programming and Scripting | 3 | 12-22-2003 06:44 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
help, using awk to get paragraph
Hi,
I'm trying to find pattern in log file. I'm using awk to search the pattern and print the paragraph. And it's not working well like I want. The file actually is TCAP message, it has format like this : ... ... ... ***************************************** INCOMING TCAP MESSAGE At Thu May 22 14:41:26 2008 ***************************************** DEST ADDR: ni=0,ri=xx,pc=0xxx ssn=xx gt={noa=4,trans=0,plan=1,enc=2,addr=blabaalba} ORIG ADDR: ni=0,ri=GT,ssn=xx gt={noa=4,trans=0,plan=1,enc=2,addr=blabab} Received TR-BEGIN: { TRANSACTION PORTION: origTransID=0x9106db37-91 06 db 37 ******* INVOKE ******* Cs1InitialDP serviceKey=XXX callingPartyNumber=(4)NUMBER callingPartysCategory=0xa locationNumber=(4)number highLayerCompatability=0x0,0x4,0x1,0x1 bearerCapability=0x0,0x0,0x0,0x10,0x3 eventTypeBCSM=2 iMSI(CAP)=XXXXX vlrNumber(CAP)=Extension:1 NoA:1 Plan: 1 Digits:XXXX cellIdFixedLength(CAP)=MCC:XX MNC:XX LAC:0XXX CellId:0xXXX callReferenceNumber(CAP)=40 1c 41 34 0e 84 a6 mscAddress(CAP)=Extension:1 NoA:1 Plan: 1 Digits:XXXXX calledPartyBCDNumber(CAP)=(0)XXXXX ********************** } ... ... I take Calling Party number as a pattern, and what I want is : search this full paragraph from Calling Party Number. I use this code Code:
awk '{RS="" } /NUMBER/' filename
How to get it full paragraph ? since it index position is unknown Thanks |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|