我有一個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