Dear Perl experts,

I have a data file which contains media per volume pool as shown below "########" line. If a name eg "CatalogBackup Pool" has 9 fields output, then it means this pool has some medias in it. I need to find the count of such lists.

The output need to be something like:

CatalogBackup pool 8 DataStore pool 0 MonthEndPool pool 0 NetBackup pool 0 None pool 0 ScratchPool pool 3

Is there any way in perl to do this?

###########################################

Here is the source data. :

###################################################################### +############################## # cat REPORT1 CatalogBackup pool 000572 HCART TLD 0 111 - - - AVAILA +BLE 002315 HCART TLD 0 355 - - - AVAILA +BLE 002316 HCART TLD 0 311 - - - AVAILA +BLE 002383 HCART TLD 0 560 - - - AVAILA +BLE 002386 HCART TLD 0 440 - - - AVAILA +BLE 002387 HCART TLD 0 537 - - - AVAILA +BLE 002390 HCART TLD 0 595 - - - AVAILA +BLE 002392 HCART TLD 0 680 - - - AVAILA +BLE DataStore pool MonthEndPool pool NetBackup pool None pool ScratchPool pool 003125 HCART TLD 0 490 - - - AVAILA +BLE 003126 HCART TLD 0 488 - - - AVAILA +BLE 003150 HCART TLD 0 480 - - - AVAILA +BLE ###################################################################### +##############################

In reply to How to generate a report based on keyword? by perl_newbie99

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.