Created
November 27, 2025 14:24
-
-
Save bviktor/6e7f360c3bb26dc96c26aebeb45bee6f to your computer and use it in GitHub Desktop.
Script to remove personal data from your Strava workouts so that you can publish it as a GPX route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TARGET="../edit/${1}" | |
| # remove HR and steps | |
| xmlstarlet ed --pf -d '_:gpx/_:trk/_:trkseg/_:trkpt/_:extensions' "${1}" > "${TARGET}" | |
| # remove banners | |
| xmlstarlet ed -L --pf -d '_:gpx/_:metadata' "${TARGET}" | |
| # remove timestamps | |
| xmlstarlet ed -L --pf -d '_:gpx/_:trk/_:trkseg/_:trkpt/_:time' "${TARGET}" | |
| # remove emtpy lines caused by --pf | |
| sed -i '/^[[:space:]]*$/d' "${TARGET}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment