ogrodas / agg

commandline csv aggregator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text maby comming some day..


EXAMPLE

ole@dev:~/agg$ ./agg.py --groupby=5 --count --countuniq=6 tests/testdata
172.16.117.132|986|970
192.168.1.1|1|1
192.168.1.30|4|4
172.16.112.50|21|21
192.168.1.20|11|11
135.13.216.191|184|184
172.16.117.111|875|844
172.16.114.148|61|28
172.16.112.10|1|1
172.16.115.234|103|103
172.16.117.103|571|549
172.16.112.100|86|1
0.0.0.0|5|1
192.168.1.90|4|4
172.16.114.168|33|33
172.16.117.52|171|171
196.227.33.189|61|61
172.16.112.20|12|2
172.16.116.201|471|471
172.16.115.87|1542|1434
172.16.116.194|235|235
135.8.60.182|85|84
192.168.1.2|1|1
195.73.151.50|34|34
172.16.115.5|849|827
195.115.218.108|122|122
172.16.114.207|36|35
194.7.248.153|92|92
172.16.113.84|68|68
172.16.114.50|13|13
172.16.113.105|417|415
197.182.91.233|71|70
196.37.75.158|54|54
197.218.177.69|67|34
194.27.251.21|120|120
172.16.113.204|23|23
172.16.114.169|81|81
192.168.1.10|2|1
172.16.113.50|1|1
172.16.112.149|19|19
172.16.112.194|138|138
172.16.112.207|1179|1118




ole@dev:~/agg$ cat tests/testdata | sed -r 's/([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9])[0-9]:[0-9]{2}/\10:00/' | ./agg.py --groupby=1 --count --countuniq=5 --sum=8 --sum=9
1999-03-01 14:10:00|355|27|26954|3682
1999-03-01 15:30:00|1223|30|249892|11254
1999-03-01 15:20:00|816|27|110781|6728
1999-03-01 16:00:00|947|21|73796|5573
1999-03-01 15:10:00|1167|24|117682|11544
1999-03-01 15:00:00|590|22|51825|7059
1999-03-01 14:40:00|257|20|164324|2028
1999-03-01 14:50:00|622|28|118813|5887
1999-03-01 15:50:00|1241|26|713459|12159
1999-03-01 14:20:00|258|24|75013|2148
1999-03-01 15:40:00|1102|25|222203|6918
1999-03-01 14:30:00|247|21|157738|7749
1999-03-01 14:00:00|85|23|3326|10256

About

commandline csv aggregator.


Languages

Language:Python 100.0%