I have a document in the following format

=====EDO=FED00123===== XXXXX XXXXX XXXXX XXXXX XXXXX UNIX Page: XX =====EDO=FED00124===== XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX UNIX Page: XX

There can be any number of FED00XXX segments and all the X's can be different depending on the report information (there can be a varying amount of XXXXX lines form 5 to 50). I have comments i need to paste after the "UNIX Page: XX" line. I am pulling them from a sqlite database and the comments correspond with the FED00XXX number.

=====EDO=FED00123===== XXXXX XXXXX XXXXX XXXXX XXXXX UNIX Page: XX Comment FED00123 =====EDO=FED00124===== XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX UNIX Page: XX Comment FED00124

The database part is easy, i just have no idea how to search for the FED number and insert the comments (will be a variable in the script pulled from the database) after the "UNIX Page: XX" line following the FED number. The FED number is pulled from the database as variable $FED and the comment as $COMMENT.

Any help would be appreciated, if anything needs to be made more clear ask, i just did not know how to explain the problem.

Thanks Sean

In reply to Paste comments in a document by siffland

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.