Hi,
I'd be glad for a little more help on this.Suppose my file looks like this:
test.txt 2004,21,21,1,16.00 2004,21,21,1,16.25 2004,22,22,1,18.00 2004,22,22,1,18.25
The data in column 0 is the 'year', and that in column 2 is the 'day', so data in column 2 can have values from 1 to 31.In this table the only values we have are '21' and '22'.

Actually, after populating the array of arrays with the data from the text file:

I need to send in succession, the data from column 4 (say), for the col 2='21' rows,then the col 2='22' rows,.....and so on to a subroutine which will process the data in some way, and return a value to the main program.

For example, for the col 2='21' rows the values ,16.00,16.25 will be send to a sub 'Process'.'Process' finds the biggest(maximum) number amongst the set, and returns that value to the main program(16.25).Next the values 18.00 and 18.25 will be sent to 'Process'(for the col 2='22' rows)and again a value will be returned to the main program.

The day of the month may be from 1-31 , so we may need to send 31 sets of data to the sub 'Process'.

Column 2 is sorted, first we have all the '21' rows, then the '22' rows, then the '23' rows and so on.

All this sounds scary.I've tried doing things, with no luck. Any code or advice would be appreciated.
Thanks ,
perl_seeker:)

In reply to Re^2: Splitting text into arrays by perl_seeker
in thread Splitting text into arrays by perl_seeker

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.