【发布时间】:2018-04-23 04:22:12
【问题描述】:
以下是我需要从中获取数据的 csv 文件
hour, count
-----------
00,23
00,34
01,34
01,45
02,30
02,50
我想写一个 power-shell 脚本,我得到以下输出
hour,max(count) for unique hours
--------------------------------
00,34
01,45
02,50
我尝试使用 group-object 和 measure-object 进行分组,但我无法获得上述预期结果
Import-Csv d:\test\serviceyrs.csv | Measure-Object -Property count -Minimum -Maximum
给我最大和最小总数,但不是我想要的
【问题讨论】:
标签: powershell powershell-2.0 powershell-3.0 powershell-4.0