Parsing a string fix message.

188 views
Skip to first unread message

Mounika Allagadda

unread,
May 11, 2016, 1:45:32 AM5/11/16
to quickfast_users
Hi,

I have a fix message as a string.
Can someone please explain me how to get each field  from the string?

Thanks,
Mounika

wengheng

unread,
May 11, 2016, 2:33:51 AM5/11/16
to quickfa...@googlegroups.com

quickfix (c++) or quickfixj (java) should help.

--
You received this message because you are subscribed to the Google Groups "quickfast_users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quickfast_use...@googlegroups.com.
To post to this group, send email to quickfa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quickfast_users/9bf66c59-7a4c-4929-8e82-ec2a30ae7868%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mounika Allagadda

unread,
May 11, 2016, 3:48:04 AM5/11/16
to quickfast_users
Can you please tell me the usage?
For example:
string fix_msg = "35=A|52=20160503-10:15:08.000|108=30|553=MDF_F";
how to get the value of 108?

Thanks,
Mounika

vikram patil

unread,
May 16, 2016, 12:25:29 AM5/16/16
to quickfast_users
Using QuickFix(c++) you can handle fix communication. Once quickfix message crack by framework, you can use setField/getField to set/retrieve fields.

Mounika Allagadda

unread,
May 20, 2016, 12:54:57 AM5/20/16
to quickfast_users
Hi,

I want to access the fields separately.
I got the solution now by splitting the string. :)

vector<string> tagValue, tagValuePairs;
std::map<std::string,std::string> fix_msg_map;

split(&tagValuePairs, decoded_message, '|');
  for(size_t i = 0; i < tagValuePairs.size(); i++) {
    if (tagValuePairs[i].empty()) { continue; }

    split(&tagValue, tagValuePairs[i], '=');
  }
  for(size_t i = 0; i < tagValue.size(); i=i+2) {
    (fix_msg_map).insert(pair<string, string>(tagValue[i],tagValue[i+1]));
  }

-Mounika

Chris Aseltine

unread,
May 20, 2016, 1:23:43 AM5/20/16
to quickfa...@googlegroups.com
This won't work for repeated groups or where the FIX value contains the '=' character.  And the performance is going to be abysmal.

--
You received this message because you are subscribed to the Google Groups "quickfast_users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quickfast_use...@googlegroups.com.
To post to this group, send email to quickfa...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages