finally, a node that i can help with *grin*
i'm assuming that there is no header row
in your text files
we will also assume you want to return columns
6, 12, and 18
while(<>){ # read through each file specified on the command line one + line at a time my @temp = split(',',$_); # take that one line and split it into a +n array determined by the commas my ($section,$value1,$value2) = ($temp[6],$temp[12],$temp[18]); # +set names to specific spots for readability $section =~ s/\"//g; # remove the ", you may have to remove 'g' to + make this work $value1 =~ s/\"//g; # it's off the top of my head ;) $value2 =~ s/\"//g; $ALLDATA{$section} = push [($value1,$value2)]; #put an array of tw +o numbers into an array those } # end while<> foreach my $key (sort keys %ALLDATA) { # go through each section (in o +rder) print "$key\n"; foreach my $array (@{$ALLDATA{$key}}) { print "\t"; foreach my $value (@{$ALLDATA{$key}[$array]} { print "$value,"; } print "\n"; } print "END_SECTION\n"; }
save the above line of code to a file
execute the command line
 perl progname.pl < datafilename >
  email me if it dosen't work achesser@nortelnetworks.com
i wrote that off the top of my head

In reply to Re: formatting help by Buckaroo Buddha
in thread formatting help by robs

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.