Files
apple-health-export-processing/steps-day.sh
2025-02-16 12:25:29 +00:00

14 lines
403 B
Bash
Executable File

#! /bin/bash
# Script to extract Huawei watch steps from Apple Health full export
# into a csv file
cat export.xml |
egrep 202[45678]- |
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 >steps.csv