From 3461a76713b41318463f15dbd115cfe424dc0299 Mon Sep 17 00:00:00 2001 From: scottc Date: Sun, 19 May 2024 10:59:37 +0000 Subject: [PATCH] Add export-to-steps-csv.sh --- export-to-steps-csv.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 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