OK, Let's take a better look at what I truly meant to be more clear about.
My text file contains backup policy information, many backup policies. Each section (policy) starts with "Policy Name:".
I'm capturing that info and a few lines of data after "Policy Name:".
Further down in the text file is:
Policy Name: Backup_Monday Active: Yes Type: Normal ----- more various garbage in between ----- Granular Restore Info: No HW/OS/Client: PC Windows2003 ds1 PC Windows2003 ds2 PC Windows2003 ds3 PC Windows2003 ds4 PC Windows2000 ds5 PC Windows2000 ds6 (blank line here) (text file continues on to other policies in the file from here)
I check the line in the file to see if it has the pattern in it (HW/OS/Client) and if it does, I want to print that line and then keep printing each subsequent line until the (blank line) is reached. Exit that loop and go back to the main loop to look for another iteration of "Policy Name:". Keep doing this through all 122 backup policies.

I guess you'd say that I have a loop inside a loop.?

Make Sense? or have I muddied the water even more?

Thanks,
Dennis

In reply to Re^3: How to print certain lines out of a text file. by sawdustar
in thread How to print certain lines out of a text file. by sawdustar

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.