I run a software firm in financial services and we use the FIX protocol. I have a straight forward coding problem. Can you provide the best sample code to my problem? The FIX protocol is tag value pair protocol with 1 FIX message per line. Every tag value pair is separated by ASCII SOH. Every FIX message ends with 10=xxx<SOH> where xxx is 3 digits. After this, the time stamp exists. I want to merge these 2 files into a 3rd file based on the time stamp on each line. The files could be fairly large (10,000,000 lines, 1 message/line, 100 bytes/message). The speed of the merge is very important. Here are 2 simple sample input files.

file 1:

8=FIX.4.29=005935=A49=X56=Y52=20121008-12:01:2734=198=0108=3010=12510/08/12 08:01:27.489799

8=FIX.4.29=004735=049=X56=Y52=20121008-12:01:5134=210=07810/08/12 08:01:51.489969

file 2:

8=FIX.4.29=6335=A34=149=B52=20121008-12:01:27.49056=A98=0108=3010=22710/08/12 08:01:27.489930

8=FIX.4.29=5135=034=249=B52=20121008-12:01:57.49056=A10=18610/08/12 08:01:57.490432


In reply to Need to efficiently merge 2 FIX protocol log files by softwareCEO

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.