Hey Tye,
Exactly, thats the problem. The array is searched 1200 times. I like your idea of searching it just once and splitting it up. Here is a sample of the file (CEL_STAT is exactly the same, only the numbers after the netid are different:)
The netid is first:
21352pa|02/27/2001|03:30|25|363|32526.4363|363|3627524|
I shortened the line, each line contains about 70 fields of data. So, basically, there is the time (03:30 in this case) and the netid. The file, is searched for every NETID and it finds around 50 (48 to be exact). one set of data for every half hour. Then this data is split at the | and then calculated on.
The only way i can think about making it faster is as it is searched, and the 50 or so lines are removed, to just delete them, thus making the main array smaller and the search will be a little faster. I like your idea from above, but i really have no idea what thats doing, and it confuses me.
Thanks Again :)
Dipul
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.