Hello oh wise and wonderful monks!

I am having some difficulty with a small script that is designed to sort csv formatted input and run some calculations. There is no set size for the number of lines.

The input is formatted as such.

123456789,123,LOGGED IN MONKEY GET (PHP),200,OK,LOGIN PHP & JAVA PILLA +RS 1-1,text,true,12345,123

Note that this is a single entry, the entire file will have potentially dozens of entries. Also important, the area "LOGGED IN MONKEY GET (PHP)" will change and can include any number of potential categories.

The scope is to grab the values from (assuming a split on comma, ie - 0,1,2,3,4,5,6,7,8,9,10) 1,3, & 8.

It will be necessary to apply a regex to tear just the 'MONKEY' portion out from column 3.

The calculation will run by first counting the number of instances of column 3. Then from there count the number of 'False' from column 8. Finally for that set it will run some calculations for avg, median, etc based the values in column 1.

I am still new to data structures and having a hard time of writing this with any sense of scalability. (I can approach it by searching for matches on column 3, but given that the number of potential strings in that column is in the hundreds, it does not make sense.) Any tips that would point me in the right direction would be uber appreciated.

Thanks so much as always for your guidance!

-bp-


In reply to Hashes, Arrays, and Confusion -- In a bit over my head! by bpthatsme

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.