Here's a framework you can work with:

<DATA>; #Get rid of the header. while(my $item=<DATA>){ chomp $item; next if not $item =~ /FROZEN/; $item =~ s/^\s+//; # Get rid of leading spaces my @f=split(/\s/,$item); my $state=pop @f; if ( $#f == 0 ) { push @f," "," "," "; } push @f,$state; printf "%s\n",join(",",@f); printf "<tr>%s</tr>\n",join " ",map { "<td>" . $_ . "</td>" } @f; } __END__ ACTIVE FULL SUSPENDED FROZEN IMPORTED ST0315 (FROZEN) ST0306 (FROZEN) ST0304 (FROZEN) ST0314 (FROZEN) ST0308 (FROZEN) ST0309 (FROZEN) ST0312 (FROZEN) ST4910 (FROZEN) ST4782 expires 06/19/2004 22:00 (FROZEN) ST2838 expires 07/09/2004 20:46 (FROZEN) ST4173 expires 07/10/2004 20:30 (FROZEN) ST1606 expires 07/14/2004 22:43 (FROZEN) ST4717 expires 05/14/2004 00:55 ST6481 expires 05/16/2004 05:22 ST2058 expires 05/16/2004 03:55 ST6540 expires 05/16/2004 01:36 ST6476 expires 05/16/2004 01:18 ST6486 expires 05/16/2004 01:35 ST1467 expires 05/16/2004 03:55 ST4730 expires 05/16/2004 01:48 ST5353 expires 05/16/2004 01:35 ST5833 expires 05/16/2004 01:36 ST3325 expires 05/16/2004 01:25 ST5413 expires 05/16/2004 01:18 ST5676 expires 05/16/2004 01:49 ST2044 expires 05/16/2004 01:46 ST3276 expires 05/16/2004 01:04


In reply to Re: Parse backup log by blue_cowdawg
in thread Parse backup log by mrbbq

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.