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 4 of 4

Thread: Java Parser

  1. #1
    Junior Member
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java Parser

    Hi Guys,

    Apologies if the post is found in the wrong area.

    I am fairly new to Java and am trying to make a little program to make my life a bit easier. The idea is to be able to parse a log file with specific messages (FIX protocol messages) and display them in a meaningful table. For Example:

    Message on log file is:
    |INFO|FIX.4.2:STP_SERVER->STP_CLIENT: 8=FIX.4.29=7635=034=112549=STP_SERVER52=20100817-22:17:00.92656=STP_CLIENT10=201
    17-08-10 22:17:00.929|QFJ Timer|quickfixj.trace|DEBUG|FIX.4.2:STP_SERVER->STP_CLIENT: File store: set(1125)

    Would display an output like:


    So basically not only return tokens but add a description to them as well. Any help/ideas would be appreciated.

    many thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,043
    Thanks
    52
    Thanked 2,280 Times in 2,251 Posts

    Default Re: Java Parser

    Can you explain how you get the data for the 4 columns from the log file record?
    And how to create the error messages.
    Or is this question only for someone that knows what a "FIX protocol" message is?

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Parser

    Thank you for replying

    Can you explain how you get the data for the 4 columns from the log file record?
    The data that you see in the table is really a manual key-in.
    Tag = numeric values 1 to 3 digits. These values are what we see in the FIX messages
    Field = description of the Tag
    Value = what value the Tag represents
    Description = what the string of Tag's mean

    so for example in 8=FIX.4.2 35=0
    Tag:8 and 35, Field: version of FIX and MsgType, Value=4.2 and 0, Description: version and HeartBeat message

    All FIX protocol has is Tag's and Description which collectively form a message.

    All I want to do is pick up all the Tag's in the string and add some useful information to them. This will allow me to make it more readable and based on the values of the tags I will be able to make sense of how the protocol is behaving.

    So, for example, in an ideal world I would drag-drop a text file with a list of messages into a GUI and it will nicely format it for me into a table.

    hope it is more clearer now

    many thanks

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,043
    Thanks
    52
    Thanked 2,280 Times in 2,251 Posts

    Default Re: Java Parser

    The drag and drop part should be easy once the parser is done.
    I think there needs to be a much more detailed definition of the records you posted to be able to parse them.
    In the record shown below, I see the following special characters: :, ->, =, |, ]
    Plus I see what are probably key words: INFO, FIX, STP_CLIENT, DEBUG, QF

    |INFO|FIX.4.2:STP_SERVER->STP_CLIENT: 8=FIX.4.29=7635=034=112549=STP_SERVER52=20100817-22:17:00.92656=STP_CLIENT10=201
    17-08-10 22:17:00.929|QFJ Timer|quickfixj.trace|DEBUG|FIX.4.2:STP_SERVER->STP_CLIENT: File store: set(1125)

    I don't see the sub message (8=FIX.4.2 35=0) in the above.

    Bottom line, no way with what you described to parse this.

Similar Threads

  1. SAX Parser will not add object to arrayList
    By michaelz in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 1st, 2010, 02:59 PM
  2. XML DOM Parser problem
    By kanishktew in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 10th, 2010, 09:42 PM
  3. recursive descent parser
    By gammaman in forum Algorithms & Recursion
    Replies: 4
    Last Post: March 21st, 2010, 03:50 AM
  4. where can i get a Dom Parser jar ?
    By chinni in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 26th, 2009, 02:41 AM
  5. Infix to Prefix parser
    By r2ro_serolf in forum Java Theory & Questions
    Replies: 1
    Last Post: November 8th, 2009, 12:11 AM