commit 3461a76713b41318463f15dbd115cfe424dc0299 Author: scottc Date: Sun May 19 10:59:37 2024 +0000 Add export-to-steps-csv.sh diff --git a/export-to-steps-csv.sh b/export-to-steps-csv.sh new file mode 100644 index 0000000..944bced --- /dev/null +++ b/export-to-steps-csv.sh @@ -0,0 +1,12 @@ +#! /bin/bash + +# Script to extract Huawei watch steps from Apple Health full export +# into a csv file + +cat export.xml | + grep 'type="HKQuantityTypeIdentifierStepCount" sourceName="HUAWEI Health"' | + cut -d\" -f 14,16 | + tr \" \ | + cut -d\ -f 1,4 | + awk '{ steps[$1]=steps[$1]+$2 } END { for (date in steps) { print date "," steps[date] } }' | + sort