Skip to content

Instantly share code, notes, and snippets.

@ruicovelo
Created February 1, 2015 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruicovelo/2581a62c0e1f4d9a13b9 to your computer and use it in GitHub Desktop.
Save ruicovelo/2581a62c0e1f4d9a13b9 to your computer and use it in GitHub Desktop.
Awkward way for getting run date, duration and distance from a set of tcx files
ls|while read file; do DATE=$(grep -m 1 StartTime "$file" | cut -d'.' -f 1| tr -s 'T' ' '| cut -d'"' -f2); TIME=$(grep -m 1 TotalTime "$file"| cut -d'>' -f2 | cut -d'<' -f1); DISTANCE=$(grep -m 1 DistanceMeters "$file"| cut -d'>' -f2 | cut -d'<' -f1); echo -e "$DATE\t$TIME\t$DISTANCE";done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment