Print output as simple CSV instead of pretty print.
cmosig opened this issue · comments
Clemens Mosig commented
Is there a way to get the output as csv instead of pretty-printed? For example ripe-atlas measurement-search --search "campaign:stuck_routes" --af 4
returns:
Filters:
Search: campaign:stuck_routes
Af: 4
Id Type Description Status
================================================================================
b'\x1b[31m7827954 traceroute campaign:stuck_routes target:84.205.71.1 Failed\x1b[0m'
b'\x1b[33m7827955 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7827956 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
[...]
b'\x1b[33m7829765 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7829766 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7829767 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7830243 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7830244 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7830245 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
b'\x1b[33m7830246 traceroute campaign:stuck_routes target:84.205.71.1 Stopped\x1b[0m'
================================================================================
Showing 50 of 423662 total measurements
A simple comma delimited csv would be nice option such that the output can be easily parsed using awk
or cut
. The output is especially hard to parse if it contains a probe description that is not surrounded by quotes.
Christopher Amin commented
CSV support added with bc3010b, plus a tab format that works well with awk