Hi..

Could somebody help me how to read data based on data length record. The data length record will be on first 4 bytes of the record. As example:-

00160AA090261666367739610000000032783210910000000029856331301060010529 +12574680529125801910000012003 300000150000181000009900400000000000000000000012000000001101600160AA09 +02616659377397100000000327816300100000000296378437010600105291252180 0529125817810000010303300006000006001000198000400000000000000000000012 +000000001101600145AA090201666337739809000000007278110810000000026764 1798010600105291257339052912584082000001900330000107000112100003960040 +0000000000000000000010160AA09026166647773991000000003272387001000000 0632983193101060010529125843405291258470100630111095000000400000610000 +03300400000000000000000000012000000000001600145AA0902016664077400090 000000043708188100000000267954007010600105
Based on example, i have to read first 4 byte which is "0160" is the length record for record 1. After finish read record 1, then i have to read first 4 bytes again for the second length record and so on until its finish.

Otherwise, actually my data has a trailer and the trailer length is fixed to 40 byte. Do you have any ideas to skip 40 bytes at the end of record?


In reply to How to capture data length from the record ? by bh_perl

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.