From 2c295e79cf80d56279edde70874969bb530ceafe Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Fri, 9 Oct 2020 17:19:11 +0200 Subject: [PATCH] chg: [export] fix CSV export TODO: Review escaping in CSV --- bin/napkin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/napkin.py b/bin/napkin.py index 38c36ea..3d94445 100644 --- a/bin/napkin.py +++ b/bin/napkin.py @@ -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]