mirror of
https://github.com/adulau/napkin-text-analysis.git
synced 2024-11-24 10:57:07 +00:00
chg: [export] fix CSV export
TODO: Review escaping in CSV
This commit is contained in:
parent
49be2bf809
commit
2c295e79cf
1 changed files with 2 additions and 2 deletions
|
@ -118,7 +118,7 @@ for anal in analysis:
|
||||||
previous_value = None
|
previous_value = None
|
||||||
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
|
x = redisdb.zrevrange(anal, 1, args.t, withscores=True, score_cast_func=int)
|
||||||
if args.o == "csv":
|
if args.o == "csv":
|
||||||
print("# Top {} of {}".format(args.t, anal))
|
print()
|
||||||
elif args.o == "readable":
|
elif args.o == "readable":
|
||||||
print("")
|
print("")
|
||||||
print("+++++ Top {} of {} +++++".format(args.t, anal))
|
print("+++++ Top {} of {} +++++".format(args.t, anal))
|
||||||
|
@ -127,7 +127,7 @@ for anal in analysis:
|
||||||
output_json.update({anal:[]})
|
output_json.update({anal:[]})
|
||||||
for a in x:
|
for a in x:
|
||||||
if args.o == "csv":
|
if args.o == "csv":
|
||||||
print("{},{}".format(a[0],a[1]))
|
print("{},{},{}".format(anal,a[0],a[1]))
|
||||||
elif args.o == "readable":
|
elif args.o == "readable":
|
||||||
if previous_value is None:
|
if previous_value is None:
|
||||||
previous_value = a[1]
|
previous_value = a[1]
|
||||||
|
|
Loading…
Reference in a new issue