To learn you need to solve the problem yourself. So I'll list only some code fragments, you can fill in the rest

AoA is a very good idea. You need an array for each column that could have multiple items in it. If this is only the Pro_ID column, a simple array will do the trick.

To collect the data in your while loop, just ignore the 'W':

if ($array[1]!='W') { $length= $array[3] } if ($array[3]!='W') { push @id, $array[3] }
You should be able to add the lines for count and character too.

If you have read a line that belongs to a new character, just call a subroutine that prints out the previous character with all the information in $count,$length and @id in a loop. You can use perl formats or spin your own formatting.

Don't forget to call the subroutine a last time after your while loop to print the last character


In reply to Re: Remove unwanted chars and maintain table integrity by jethro
in thread Remove unwanted chars and maintain table integrity by Anonymous Monk

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.