Results 1 to 10 of 10

Thread: File read & write problem..pls help me..

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2010
    Posts
    20

    File read & write problem..pls help me..

    Hello,

    I have a file called infile.txt where there are some datas. After so many lines again same data repeats with having different value.

    I want to search value for particular parameter calledSubscriberIMSI & throughout the file where this value matches for calledSubscriberIMSI, it will take all the datas & produce it to a output file called outfile.txt.

    Sample values are given below...

    UMTSGSMPLMNCallDataRecord
    mSTerminatingSMSinMSC
    dateForStartOfCharge 07020D'H
    exchangeIdentity "BBSR_MSC_R11"'S
    recordSequenceNumber 25510'D
    timeForStartOfCharge 17 2 44'BCD
    outputType 04'H
    switchIdentity 0001'H
    callIdentificationNumber 54292'D
    chargedParty 00'H
    outgoingRoute "OBBKJRO"'S
    calledSubscriberIMEI 358364004355120F'TBCD
    calledSubscriberIMSI 404281130154600F'TBCD
    firstCalledLocationInformation 04F48239DB7157'H
    ->2|0|63 09'H
    calledPartyNumber 11919853313214'TBCD
    frequencyBandSupported 00'H
    teleServiceCode 21'H
    mSCIdentification 11919853099002'TBCD
    lastCalledLocationInformation 04F48239DB7157'H
    serviceCentreAddress 11919854099060'TBCD
    tAC 04020B'H
    originForCharging 00'H
    messageTypeIndicator 00'H
    originatingAddress 0E1C4A47854620'TBCD


    UMTSGSMPLMNCallDataRecord
    mSTerminatingSMSinMSC
    dateForStartOfCharge 07020D'H
    exchangeIdentity "BBSR_MSC_R11"'S
    recordSequenceNumber 25511'D
    timeForStartOfCharge 17 2 44'BCD
    outputType 04'H
    switchIdentity 0001'H
    callIdentificationNumber 54293'D
    chargedParty 00'H
    outgoingRoute "OBBCUTO"'S
    calledSubscriberIMEI 357088005862520F'TBCD
    calledSubscriberIMSI 404281130154601F'TBCD
    firstCalledLocationInformation 04F48237847937'H
    ->2|0|63 09'H
    calledPartyNumber 11919853313210'TBCD
    frequencyBandSupported 00'H
    teleServiceCode 21'H
    mSCIdentification 11919853099002'TBCD
    lastCalledLocationInformation 04F48237847937'H
    serviceCentreAddress 11919854099060'TBCD
    tAC 04020B'H
    originForCharging 00'H
    messageTypeIndicator 00'H
    originatingAddress 0E1C4A47854620'TBCD


    UMTSGSMPLMNCallDataRecord
    mSTerminatingSMSinMSC
    dateForStartOfCharge 07020D'H
    exchangeIdentity "BBSR_MSC_R11"'S
    recordSequenceNumber 25512'D
    timeForStartOfCharge 17 2 44'BCD
    outputType 04'H
    switchIdentity 0001'H
    callIdentificationNumber 54308'D
    chargedParty 00'H
    outgoingRoute "OBBBHUO"'S
    calledSubscriberIMEI 351119608143270F'TBCD
    calledSubscriberIMSI 404281130154600F'TBCD
    firstCalledLocationInformation 04F482371F9DDD'H
    ->2|0|63 09'H
    calledPartyNumber 11919853313209'TBCD
    frequencyBandSupported 00'H
    teleServiceCode 21'H
    mSCIdentification 11919853099002'TBCD
    lastCalledLocationInformation 04F482371F9DDD'H
    serviceCentreAddress 11919854099060'TBCD
    tAC 04020B'H
    originForCharging 00'H
    messageTypeIndicator 00'H
    originatingAddress 0E1C4A47854620'TBCD

    Pls note that for each record, UMTSGSMPLMNCallDataRecord is common which i have made in bold & again starts another record. Now, I want to search data 404281130154600 for calledSubscriberIMSI . In this case it has ben found twice. so my program should take the whole segment i.e from UMTSGSMPLMNCallDataRecord to originatingAddress for 1st occurance & again from UMTSGSMPLMNCallDataRecord to originatingAddress for 2nd ocuurance & put it to a file outfile.txt.

    pls help me to solve the issue..I have attached an input file infile.txt

    Thnkx & Regards
    Sajib
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width