Hi All,
I need a logic for the below.
Suppose I have the file in a particular directory with the below conntent starts with the below line -
5/15/2014 2:07:36 PM : 10 - 10 : *** Loading XML file DSH_000001_pos.xml ***
After that the content is shown below.
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for PERIOD DSH - TRDBOOK +NSCCL :INR - HOUS - (INR).
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for Exchange Complex NSCCL PERIOD Exchange Complex (INR).
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for Combined Commodity ANDHRABANK - ANDHRABANK PERIOD Combined Commodity (INR).
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for PERIOD DSH - CFDTRADING +ASXCC :GBP - HOUS - (GBP).
5/15/2014 2:07:36 PM : 20 - 30 : For <ecPort> ASXCC can't find required associated object <clearingOrg>
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for PERIOD DSH - FUTINDXBOOK +CDC :CAD - HOUS - (CAD).
5/15/2014 2:07:36 PM : 20 - 30 : For <ecPort> CDC can't find required associated object <clearingOrg>
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for PERIOD DSH - CFDTRADING +ASXCC :AUD - HOUS - (AUD).
5/15/2014 2:07:36 PM : 20 - 30 : For <ecPort> ASXCC can't find required associated object <clearingOrg>
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for PERIOD DSH - HARBOOK01 +NSCCL :INR - HOUS - (INR).
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for Exchange Complex NSCCL PERIOD Exchange Complex (INR).
5/15/2014 2:07:36 PM : 20 - 30 : For <ccPort> ANDHBANK can't find required associated object <ccDef>
5/15/2014 2:07:36 PM : 10 - 30 : Loading positions for Combined Commodity ABIRLANUVO - ABIRLANUVO PERIOD Combined Commodity (INR).
5/15/2014 2:07:36 PM : 20 - 30 : Can not find Contract 20140526 in Product Family ABIRLANUVO FUT in Exchange NSE
5/15/2014 2:07:36 PM : 10 - 60 :
Here it loads the each period ( Eg: Loading positions for PERIOD DSH - TRDBOOK +NSCCL :INR - HOUS - (INR) ) after that
for each period it throws the error with 20 - 30 codes Eg: For <ecPort> ASXCC can't find required associated object <clearingOrg> for the period DSH - CFDTRADING +ASXCC :GBP - HOUS - (GBP).
So, we need to find out the errors for the each period.
Can you please let us know how can we write the code for this.
For the above input - out put should be -
1.
PERIOD - PERIOD DSH - CFDTRADING +ASXCC :GBP - HOUS - (GBP)
ERRORS - <ecPort> ASXCC can't find required associated object <clearingOrg>
2.
PERIOD - DSH - FUTINDXBOOK +CDC :CAD - HOUS - (CAD)
ERRORS - <ecPort> CDC can't find required associated object <clearingOrg>
3.
PERIOD - DSH - CFDTRADING +ASXCC :AUD - HOUS - (AUD)
ERRORS - <ecPort> ASXCC can't find required associated object <clearingOrg>
4.
PERIOD - DSH - HARBOOK01 +NSCCL :INR - HOUS - (INR)
ERRORS - <ccPort> ANDHBANK can't find required associated object <ccDef>
Can not find Contract 20140526 in Product Family ABIRLANUVO FUT in Exchange NSE
--- Update ---
Hi Quick reply should be appreciated.