|The stupid question is the question not asked|
Advances SQL calculations in CSV fileby DrAxeman (Beadle)
|on Aug 31, 2005 at 16:50 UTC||Need Help??|
DrAxeman has asked for the
wisdom of the Perl Monks concerning the following question:
I have an issue that I'm not sure how to approach. I apologize in advance if I do not explain my delima clearly the first time. I'm not sure how to explain it...
I have CSV files that contain statistical data. I need to be able to extract this data in a format that gives me the TOP 5% (highest value) for certain columns, along with certain the data contained in the same rows. What's got me stumped, is that I don't need the TOP 5% of the table, but the top 5% of each server having data collected on it. I also need the TOP 5% of multiple columns. Let me provide an example:
My data looks similar to this (just LOTS more of it). There are a lot more columns, so I trimmed this down a little. The first row is the headers:
The first column is a date/time stamp. The rest of the columns are server name & statistic collected. For each column with "ProcessorTotalPCT" in it, I need the TOP 5 % numbers along with the data from the same column. Then I also need the same thing done with for the columns with "MemoryPagessec" in it. I would also like the data split into to files. One for CPU and one for the RAM info.
Final output should look similar to:
Thanks in advance. I hope that I wasn't too confusing.