No idea how i would go about this, completly new to awk, but does anyone know how i would do the following :
I need to pull from a file all lines where the line has AddressStringDigits in it and CallTypeLevel1,2 &3... and enter into a new file
For example :
CDR 25,( AddressStringDigits 0x"0034607311112f"),(CallTypeLevel1 0x"02") -- 2,( CallTypeLevel2 0x"02") -- 2,
( CallTypeLevel3 0x"01") -- 1
CDR 26,( AddressStringDigits 0x"0034686830367f"),
( CallTypeLevel1 0x"02") -- 2,( CallTypeLevel2 0x"02") --2,
( CallTypeLevel3 0x"01") -- 1
Would be taken from :
-- CDR 25
( MobileOriginatedCall
( MoBasicCallInformation
( SimChargeableSubscriber
( Imsi 0x"214015001189242f")
)
( Destination
( TypeOfNumber 0x"00") -- 0
( NumberingPlan 0x"01") -- 1
( AddressStringDigits 0x"0034607311112f")
)
( CallEventStartTimeStamp
( LocalTimeStamp "20040224082330") -- 0x"3230303430323234303832333330"
( UtcTimeOffsetCode "/") -- 0x"2f", 47
)
( TotalCallEventDuration "6") -- 0x"36", 54
)
( LocationInformation
( NetworkLocation
( RecEntityCode 0x"07") -- 7
( LocationArea 0x"0145") -- 325
)
)
( BasicServiceUsedList
( BasicServiceUsed
( BasicService
( TeleServiceCode "11") -- 0x"3131", 12593
)
( ChargeInformationList
( ChargeInformation
( ChargedItem "D") -- 0x"44", 68
( ExchangeRateCode 0x"01") -- 1
( CallTypeGroup
( CallTypeLevel1 0x"02") -- 2
( CallTypeLevel2 0x"02") -- 2
( CallTypeLevel3 0x"01") -- 1
( CalledCountryCode "34") -- 0x"3334", 13108
)
( ChargeDetailList
( ChargeDetail
( ChargeType "00") -- 0x"3030", 12336
( Charge 0x"02a5") -- 677
( ChargeableUnits "6") -- 0x"36", 54
( DayCategory "I") -- 0x"49", 73
( TimeBand "I") -- 0x"49", 73
)
)
)
)
( DataVolumeReference 0x"00") -- 0
)
)
( CamelServiceUsed
( AddressStringDigits 0x"1134607009902f")
( CamelServiceLevel 0x"00") -- 0
( CamelServiceKey 0x"0d1d") -- 3357
( CamelCallReference
( AddressStringDigits 0x"447953706101")
( CamelCallReferenceNumber "1621819392") -- 0x"31363231383139333932"
)
)
)
-- CDR 26
( MobileOriginatedCall
( MoBasicCallInformation
( SimChargeableSubscriber
( Imsi 0x"214012001453079f")
)
( Destination
( TypeOfNumber 0x"01") -- 1
( NumberingPlan 0x"01") -- 1
( AddressStringDigits 0x"0034686830367f")
)
( CallEventStartTimeStamp
( LocalTimeStamp "20040224082207") -- 0x"3230303430323234303832323037"
( UtcTimeOffsetCode "/") -- 0x"2f", 47
)
( TotalCallEventDuration 0x"09") -- 9
)
( LocationInformation
( NetworkLocation
( RecEntityCode 0x"0d") -- 13
( LocationArea 0x"01b6") -- 438
)
)
( BasicServiceUsedList
( BasicServiceUsed
( BasicService
( TeleServiceCode "11") -- 0x"3131", 12593
)
( ChargeInformationList
( ChargeInformation
( ChargedItem "D") -- 0x"44", 68
( ExchangeRateCode 0x"01") -- 1
( CallTypeGroup
( CallTypeLevel1 0x"02") -- 2
( CallTypeLevel2 0x"02") -- 2
( CallTypeLevel3 0x"01") -- 1
( CalledCountryCode "34") -- 0x"3334", 13108
)
( ChargeDetailList
( ChargeDetail
( ChargeType "00") -- 0x"3030", 12336
( Charge 0x"02a5") -- 677
( ChargeableUnits 0x"09") -- 9
( DayCategory "I") -- 0x"49", 73
( TimeBand "I") -- 0x"49", 73
)
)
)
)
( DataVolumeReference 0x"00") -- 0
)
)
( CamelServiceUsed
( AddressStringDigits 0x"1134607009901f")
( CamelServiceLevel 0x"00") -- 0
( CamelServiceKey 0x"0d1c") -- 3356
( CamelCallReference
( AddressStringDigits 0x"447953710103")
( CamelCallReferenceNumber "1809907712") -- 0x"31383039393037373132"
)
)
)
I hope someone can make some sense of this...!!
Many thanks to whoever can help.
Nick
I need to pull from a file all lines where the line has AddressStringDigits in it and CallTypeLevel1,2 &3... and enter into a new file
For example :
CDR 25,( AddressStringDigits 0x"0034607311112f"),(CallTypeLevel1 0x"02") -- 2,( CallTypeLevel2 0x"02") -- 2,
( CallTypeLevel3 0x"01") -- 1
CDR 26,( AddressStringDigits 0x"0034686830367f"),
( CallTypeLevel1 0x"02") -- 2,( CallTypeLevel2 0x"02") --2,
( CallTypeLevel3 0x"01") -- 1
Would be taken from :
-- CDR 25
( MobileOriginatedCall
( MoBasicCallInformation
( SimChargeableSubscriber
( Imsi 0x"214015001189242f")
)
( Destination
( TypeOfNumber 0x"00") -- 0
( NumberingPlan 0x"01") -- 1
( AddressStringDigits 0x"0034607311112f")
)
( CallEventStartTimeStamp
( LocalTimeStamp "20040224082330") -- 0x"3230303430323234303832333330"
( UtcTimeOffsetCode "/") -- 0x"2f", 47
)
( TotalCallEventDuration "6") -- 0x"36", 54
)
( LocationInformation
( NetworkLocation
( RecEntityCode 0x"07") -- 7
( LocationArea 0x"0145") -- 325
)
)
( BasicServiceUsedList
( BasicServiceUsed
( BasicService
( TeleServiceCode "11") -- 0x"3131", 12593
)
( ChargeInformationList
( ChargeInformation
( ChargedItem "D") -- 0x"44", 68
( ExchangeRateCode 0x"01") -- 1
( CallTypeGroup
( CallTypeLevel1 0x"02") -- 2
( CallTypeLevel2 0x"02") -- 2
( CallTypeLevel3 0x"01") -- 1
( CalledCountryCode "34") -- 0x"3334", 13108
)
( ChargeDetailList
( ChargeDetail
( ChargeType "00") -- 0x"3030", 12336
( Charge 0x"02a5") -- 677
( ChargeableUnits "6") -- 0x"36", 54
( DayCategory "I") -- 0x"49", 73
( TimeBand "I") -- 0x"49", 73
)
)
)
)
( DataVolumeReference 0x"00") -- 0
)
)
( CamelServiceUsed
( AddressStringDigits 0x"1134607009902f")
( CamelServiceLevel 0x"00") -- 0
( CamelServiceKey 0x"0d1d") -- 3357
( CamelCallReference
( AddressStringDigits 0x"447953706101")
( CamelCallReferenceNumber "1621819392") -- 0x"31363231383139333932"
)
)
)
-- CDR 26
( MobileOriginatedCall
( MoBasicCallInformation
( SimChargeableSubscriber
( Imsi 0x"214012001453079f")
)
( Destination
( TypeOfNumber 0x"01") -- 1
( NumberingPlan 0x"01") -- 1
( AddressStringDigits 0x"0034686830367f")
)
( CallEventStartTimeStamp
( LocalTimeStamp "20040224082207") -- 0x"3230303430323234303832323037"
( UtcTimeOffsetCode "/") -- 0x"2f", 47
)
( TotalCallEventDuration 0x"09") -- 9
)
( LocationInformation
( NetworkLocation
( RecEntityCode 0x"0d") -- 13
( LocationArea 0x"01b6") -- 438
)
)
( BasicServiceUsedList
( BasicServiceUsed
( BasicService
( TeleServiceCode "11") -- 0x"3131", 12593
)
( ChargeInformationList
( ChargeInformation
( ChargedItem "D") -- 0x"44", 68
( ExchangeRateCode 0x"01") -- 1
( CallTypeGroup
( CallTypeLevel1 0x"02") -- 2
( CallTypeLevel2 0x"02") -- 2
( CallTypeLevel3 0x"01") -- 1
( CalledCountryCode "34") -- 0x"3334", 13108
)
( ChargeDetailList
( ChargeDetail
( ChargeType "00") -- 0x"3030", 12336
( Charge 0x"02a5") -- 677
( ChargeableUnits 0x"09") -- 9
( DayCategory "I") -- 0x"49", 73
( TimeBand "I") -- 0x"49", 73
)
)
)
)
( DataVolumeReference 0x"00") -- 0
)
)
( CamelServiceUsed
( AddressStringDigits 0x"1134607009901f")
( CamelServiceLevel 0x"00") -- 0
( CamelServiceKey 0x"0d1c") -- 3356
( CamelCallReference
( AddressStringDigits 0x"447953710103")
( CamelCallReferenceNumber "1809907712") -- 0x"31383039393037373132"
)
)
)
I hope someone can make some sense of this...!!
Many thanks to whoever can help.
Nick