我有一个CSV格式的事务日志文件,我想用它来运行统计信息。日志具有以下字段:直接从CSV文件计算统计信息
date: Time/date stamp salesperson: The username of the person who closed the sale promo: sum total of items in the sale that were promotions. amount: grand total of the sale
我希望得到以下数据:
salesperson: The username of the salesperson being analyzed. minAmount: The smallest grand total of this salesperson's transaction. avgAmount: The mean grand total.. maxAmount: The largest grand total.. minPromo: The smallest promo amount by the salesperson. avgPromo: The mean promo amount...
我很想建立一个数据库结构,导入此文件,写SQL,和拉统计数据。除了这些统计数据,我不需要这些数据。有更容易的方法吗?我希望一些bash脚本可以使这一点变得简单。
问题的哪一部分是您遇到问题?统计数据本身?数据结构?解析?对于任何您熟悉的脚本语言来说,这似乎不是一个非常难的问题。 – Kena 2010-04-16 19:30:58
*拥抱PowerShell * ... – Joey 2010-04-16 19:42:00