chg: [export] fix CSV export

TODO: Review escaping in CSV
This commit is contained in:
Alexandre Dulaunoy 2020-10-09 17:19:11 +02:00
parent 49be2bf809
commit 2c295e79cf
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -118,7 +118,7 @@ for anal in analysis:
previous_value = None
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
if args.o == "csv":
print("# Top {} of {}".format(args.t, anal))
print()
elif args.o == "readable":
print("")
print("+++++ Top {} of {} +++++".format(args.t, anal))
@ -127,7 +127,7 @@ for anal in analysis:
output_json.update({anal:[]})
for a in x:
if args.o == "csv":
print("{},{}".format(a[0],a[1]))
print("{},{},{}".format(anal,a[0],a[1]))
elif args.o == "readable":
if previous_value is None:
previous_value = a[1]