The point of all that ugly code below is to tell you that if you want custom views on your data, you need to make them. Use subroutines that return data or print data like the ones below. It's also there because I think that's a good data structure for you to use.
#!/usr/local/bin/perl -w use strict; $|++; use constant TITLES => 1; my $data = {}; while ( <DATA> ) { my $row = [ split /,/ ]; push @{$data->{$row->[0]}}, $row; } sub totals_report { my $data = shift; print "Totals Report:\n" if TITLES; foreach ( sort keys %{$data} ) { print $_ . ":\t" . @{$data->{$_}} . "\n"; } } sub print_col { my $data = shift; my $col = shift || 0; print 'Column ' . $col . " print out:\n" if TITLES; foreach my $type ( sort keys %{$data} ) { print $type . ":\n" if TITLES; foreach my $row ( @{$data->{$type}} ) { print "\t" . ( $row->[$col] || '[none]' ) . "\n"; } } } totals_report( $data ); print "\n\n"; print_col( $data, 3 ); __DATA__ HDR,831 Reconciliation,200008081441EST BGN,11,000000158,20000808,10520000 OTI,GH,BT,WEDI620000802,159 AMT,2,231644 AMT,BT,231644 AMT,NP,0 QTY,46,10 QTY,53,0 QTY,54,10 QTY,55,0 TED,ZZZ,BATCH AWAITING 831 OTI,TR,CK,0021000095,159,000101416 TED,ZZZ,MOD CHECK ON RDFI-ID FAILED
Enjoy
--
Casey

In reply to Re: Creating the right type of array... by cwest
in thread Creating the right type of array... 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.