1
0
mirror of https://github.com/balkian/bitter.git synced 2024-12-22 08:28:12 +00:00
bitter/bin/extract-limits.sh
J. Fernando Sánchez 53bb7edabc Add sh scripts
2018-03-19 14:35:07 +01:00

17 lines
305 B
Bash
Executable File

if [ "$#" -lt 1 ]
then
echo "Usage: $0 <files to convert>"
exit 1
fi
export QUERY='.limit | select(. != null) | [.timestamp_ms, .track] | @csv'
export FIELDS="timestamp,track"
for i in "$@"
do
OUTPUT=$i.limits.csv
echo $FIELDS > $OUTPUT
pv -N "$i limits" -l $i | jq -r "$QUERY" >> $OUTPUT
done