I need to parse a txt file like below.
starts from the first occurence of
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
till the last occurence of
}
in other saying name of the part(header) is SASN2010Aber.CallEventRecord.egsnPDPRecord
and the content of the header is in two parenthesis {}
, untill the next header.
How can I parse and separate these headers including content?
text file is below;
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
recordType : '70'D
chargingID : '306457009'D
sgsnAddress
{
Address : 'FBDC'H
}
pdpType : 'F121'H
dynamicAddressFlag : '1'D
listOfTrafficVolumes
{
[0]
{
changeTime : '1412031353342B0200'H
}
}
duration : '0'D
causeForRecClosing : '0'D
recordSequenceNumber : '1'D
rATType : '1'D
listOfServiceData
{
[0]
{
ratingGroup : '4'D
resultCode : '4010'D
timeUsage : '0'D
timeOfReport : '1412031353342B0200'H
failureHandlingContinue : '0'D
serviceIdentifier : '404'D
}
}
}
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
recordType : '70'D
chargingID : '306457009'D
sgsnAddress
{
Address : 'FBDC'H
}
pdpType : 'F121'H
dynamicAddressFlag : '1'D
listOfTrafficVolumes
{
[0]
{
changeTime : '1412031353342B0200'H
}
}
causeForRecClosing : '0'D
rATType : '1'D
listOfServiceData
{
[0]
{
ratingGroup : '4'D
resultCode : '4010'D
failureHandlingContinue : '0'D
serviceIdentifier : '404'D
}
[1]
{
ratingGroup : '4'D
resultCode : '4010'D
failureHandlingContinue : '0'D
serviceIdentifier : '404'D
}
}
}
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
sgsnAddress
{
Address : 'FBDC'H
}
pdpType : 'F121'H
listOfTrafficVolumes
{
[0]
{
changeTime : '1412031353342B0200'H
}
}
duration : '0'D
listOfServiceData
{
[3]
{
ratingGroup : '4'D
resultCode : '4010'D
timeUsage : '0'D
serviceIdentifier : '404'D
}
}
}
the output need to be like below (3 divided);
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
.
.
.
.
.
.
}
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
.
.
.
.
.
.
}
SASN2010Aber.CallEventRecord.egsnPDPRecord
{
.
.
.
.
.
.
}