Hi,

This is my data, I want to extract:

INPUT_NAME INPUT_DATA INFO LSB Length : 76 [4c] Version : >04< [04] Record length : 0 [00] Record Type : '1' [01] Efficiency Indicator : '0' Successful Term Type : '0' [00] Unefficiency Cause : 'f' Resource Alloc Ind : 'f' [ff] Term Origin : 'f' Term Indicator : 'f' [ff] Info Teleservice : 33 [21] Required Bearer Service : 255 [ff] Time Stamp 1 : >030720215113< [03 07 20 21 51 13] Country Code : 1 [00 00 01] Time Stamp 2 : >030720215113< [07 20 21 51 13] Input Info : >5341870393005150< [53 41 87 03 93 00 5 +1 50] List Of Invoked Supp Ser : >< List Information : >1960136771453< [91 06 31 76 17 54 f3] Price ID : >502130101789872< [05 12 03 01 71 98 78 + f2] Price Code : >910631420033f9< [91 06 31 42 00 33 f9] Discount Identity : >1960132400000< [91 06 31 42 00 00 f0] FOC Identity : >0085 3217< [05 f2 31 00 85 32 17] extension : >< Required Bearer Capability : >"FREE< <br>Info Recei frm Fixed Supp +: ><

Actually, they are lot of information here and split by new line. And, I have some trouble here to capture some input_data based on the input_name, as example :

Record Type : 1 Country Code : 1 List Information : 1960136771453 Discount Identity : 1960132400000 Price Code : 910631420033f9 Required Bearer Capability : FREE Info Recei frm Fixed Supp : #(Change to FREE)
The INFO colums could be ignore.

But, if the "Required Bearer Capability" or "Info Recei frm Fixed Supp" are blank then change their input data to "FREE". Then, all the input data will be used for the next calculation based on the "Required Bearer Capability" and "Info Recei frm Fixed Supp" items with the next information/data.

Thanks for your attention,

Edit by tye, formatting


In reply to Read and captured selected input data ? 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.