Hi Monks, please help me to solve this problem: here is the part of my script:
<p>1) 'CALL @ MAKE WHOLE + 37 1/2 BP. <p>2) CPN INC/DEC 25BP FOR EACH RTG UPGRADE/DOWNGRADE. ISS'D IN EXCH O +F 144A/REGS SEC.UNSEC'D. CALL @ > PAR OR MAKE WHOLE + 45 BP. LONG 1ST + CPN. <p>Requirement - <p>* 1. When MAKE_WHOLE_CALL = 'Y', Look for word "MAKE WHOLE" or "M +AKE-WHOLE" or "MKWL" in NOTES_DES field. (Note: we can get 21 more securities covered if add words " MAKEWHOLE" + and "MAKE WHOLE" (2 spaces between MAKE and WHOLE), this will puts u +s around 95% coverage) <p>* 2. Scan each character after one of the above words found, star +ting from the position the word found + length (word found), until a +numeric character is found but exit if the current position is = Leng +th(Notes Des) or a character "." is found before a numeric value foun +d. <p>* 3. Once the numeric value is found, accumulate the numeric char +acters until the next character is "B" or Space or the position = Len +gth (Notes Des). If the current character is a "." then see if the next character is nu +meric, if it is then take both "." and numeric characters and continu +e, otherwise exit. If the current character is Space then see if the next 3 characters ar +e "1/2" then append ".5" to the accumulated numeric value. <p>* 4. Write the value found in the above logic to NOTES_DES locati +on in the original record. <P> my required output will be 37.5 and 45.
<p>Existed code - <p> the script to remove the . is: $all=~s/\./\n/g; <p> the script to find the digits from the records if 'MAKE WHOLE' present in the record: #if($all=~/MAKE WHOLE/) #{ #if($all=~/(\d+)/g) #{ #print $1; # #} #print $1; #} #else #{ #print "bye"; #} <p> the above script is not working ie. it give me only 37, because it will match 37 1/2 and 45.

In reply to problem with records: by roc

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.