Hi Everyone,
I'm somewhat new to perl and have been manually (visually) comparing a text import file consisting of a trailer that indicates the number of "records" that should be imported into an application. I then have to check a text "log/report" that indicates the actual Total Records imported ## into the system. I probably could have mulled through this one on my own but the caveat is there are three types of records (3 place holders in the trailer) and 3 corresponding "Total Records Imported :##" entries in the generated log/report. There is nothing unique to map to in the report except that the sequence will remain the same i.e. trailer1 placeholder will be the first "Total records imported :##" entry and trailer2 place holder will be the second "Total Records imported entry and so on". The "Total Records imported:##" and Trailer# place holder should be equal to one another (hence the visual checking :) I have searched hi and lo for help but am being pulled mostly to source code comparison utilities which doesn't seem to correlate to me needs. Any help would be much much appreciated!

Here is an example of the Trailer thread

T0000000000000018700000000011345000000000000000000000

(in terms of orientation it is the very last line in the record) Here is an example of the corresponding log/record

output: Total Records Processed: 187

I know from the trailer (Character space 18 to 11 is used for A records and the other number is the B Record or Character 33 to 28) so the first Total Record found in the log should be followed by 187 (A record) and the 2nd Total Record should correspond to the B record number). Ideally I would like to email myself either a successful or failure message.

Reformatted to match original input as best as could be determined by davido.


In reply to Need to compare import Trailer to Result Log by jwebste1

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.