Skip to content

Instantly share code, notes, and snippets.

@smallfield
Last active January 7, 2024 14:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smallfield/8487367 to your computer and use it in GitHub Desktop.
Save smallfield/8487367 to your computer and use it in GitHub Desktop.
Extract general information from Wahoo workout data(CSV).
#usage
# find %Dropbox%/Apps/Wahoo | grep csv$ | sort | awk -f wahoo2csv.awk
# Date, TotalDistance, Time, AverageSpeed
BEGIN {
FS=","
general_info_flg=0
distance=0
}
$1 == "Year" {
printf("\"%04d/%02d/%02d %02d:%02d\",",$2,$4,$6,$8,$10)
}
general_info_flg {
distance+=$5/1000
printf("\"%.3f\",\"%.3f\",\"%.3f\"\n", distance, $3/60, $7*3600/1000)
general_info_flg=0
}
/^workout,/{
general_info_flg=1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment