Computing.Net > Forums > Unix > Using awk to prnt selective colums

Using awk to prnt selective colums

Reply to Message Icon

Original Message
Name: gpta_varun
Date: January 15, 2008 at 20:40:31 Pacific
Subject: Using awk to prnt selective colums
OS: Unix
CPU/Ram: n
Model/Manufacturer: n
Comment:

Hi ,

This is the functionality I required ...

Suppose the input file is

! TICKET NBR : 3 ! GSI : 14 ! 20.0.1.1 0 ! 20.0.1.1 0
! 20.0.1.2 0 ! 20.0.2.1 0 ! 3100.2.10.2
9422000002 ! 3100.2.10.1 3 ! 3100.2.23.1
404669422000002 ! 3100.2.38.1 0 ! 3100.2.18.1 0 ! 3
100.2.22.4 0 ! 3100.2.24.1 1000 ! 3100.2.28.1 5 !
3100.2.28.2 0 ! 3100.2.28.4 5 ! 3100.2.28.5
0 ! 3100.2.28.3 0 ! 3100.2.28.6 0 ! 3100.2.44.1 123 !
3100.2.49.1 0 ! 3100.2.22.1 224 ! 3100
.2.34.1 14/01/2008 01:00:05 ! 3100.2.34.2 00:00:01 !
1.2.1.7 14/01/2008 01:00:05 ! 1.2.1.6 00
:00:01 ! 3113.1.1.5 0 ! 1.0.1.1 0 ! 1.0.6.1 0 !
1.2.1.5 14/01/2008 01:00:04 !

! TICKET NBR : 4 ! GSI : 14 ! 20.0.1.1 0 ! 20.0.1.1 0
! 3113.4.1.1 0 ! 3100.2.10.2 9422000010
! 3100.2.10.1 3 ! 3100.2.23.1 404669422000010 !
3100.2.38.1 0 ! 3100.2.18.1 0 ! 3100.2.22.4
0 ! 3100.2.24.1 93600 ! 3100.2.28.1 3 ! 3100.2.28.2 0
! 3100.2.28.4 3 ! 3100.2.28.5 0 ! 3100.
2.28.3 0 ! 3100.2.28.6 0 ! 3100.2.44.1 123 !
3100.2.49.1 0 ! 3100.2.22.1 224 ! 3100.2.34.1 14
/01/2008 01:00:05 ! 3100.2.34.2 00:00:01 ! 1.2.1.7
14/01/2008 01:00:05 ! 1.2.1.6 00:00:01 ! 3
113.1.1.5 0 ! 1.0.1.1 0 ! 1.0.6.1 0 ! 1.2.1.5
14/01/2008 01:00:05 !


And
3100.2.10.2=CALLING NUMBER
3100.2.23.1=MSISDN
3100.2.22.1=CALL TYPE

Now I need an search all records with call type = 224
and print the corresponding CALLING NUMBER , MSISDN


eg .

CALLTYPE MSISDN CALLINGNO .

224 ........ ........
224 ........ ........
224 ....... ........



Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Using awk to prnt selective colums

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge