Skip to content

Instantly share code, notes, and snippets.

@marcov
Created May 29, 2019 12:42
Show Gist options
  • Save marcov/df3e4551373631317e1bc3102b58bf47 to your computer and use it in GitHub Desktop.
Save marcov/df3e4551373631317e1bc3102b58bf47 to your computer and use it in GitHub Desktop.
Filter out private fields from TCS / GPX files

Filter out private fields from TCX or GPX files

If you dont want n'importe qui (a.k.a. everybody) to see you power or heart rate value of your public Strava activities, just give the log file a nice scrub with sed.

Examples

Removing power from TCX:

sed -i -E "/^ *<Watts>[0-9]*<\/Watts> *$/d" myride.tcx

Removing power from GPX:

sed -i -E "/^ *<power>[0-9]*<\/power> *$/d" myride.gpx

If in doubt, omit the -i flag to inspect the actual output on stdout without having sed changing the file content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment