Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Code Required in the form of Key Values

  1. #1
    Junior Member
    Join Date
    May 2014
    Location
    Hyderabad
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Code Required in the form of Key Values

    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.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Code Required in the form of Key Values

    What have you tried? What exactly about this are you stuck on?

    If you want a quick reply, then you should post an SSCCE and ask a specific technical question. See the link in my signature on asking questions the smart way for more info.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    May 2014
    Location
    Hyderabad
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Code Required in the form of Key Values

    In the above message for each line "Loading positions for PERIOD", it has to find out the errors under that line which starts with 20 -30.

Similar Threads

  1. retrieving hashmap data in table format based key values
    By swapnareddy in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: April 16th, 2013, 08:48 AM
  2. [SOLVED] Get a new key in HashMap with values of another key.
    By Purple01 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 21st, 2012, 04:33 AM
  3. retrieve data from database using Hashmap (multiple values in one key)
    By ashin12 in forum Collections and Generics
    Replies: 2
    Last Post: April 4th, 2012, 05:22 AM
  4. [SOLVED] compare form values with database values
    By VaniRathna in forum Java Servlet
    Replies: 2
    Last Post: October 24th, 2011, 02:48 AM
  5. [SOLVED] restricting a particular key stroke or key code
    By chronoz13 in forum AWT / Java Swing
    Replies: 2
    Last Post: April 22nd, 2011, 11:19 AM