This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A solution for combining/merging two TCX files (activies)

Former Member
Former Member
This weekend I needed to adjust my interval workout while it was in progress (yes, I needed a break!) This resulted in me having two different activities and two TCX files for each.

I searched and downloaded various software, but they didn't do exactly what I wanted. (Some didn't preserve the calories, and some turned the workout into a course, etc)

I then tried just copying all the laps from one TCX to the other using notepad, but that didn't work either. The distance was corrupt when I uploaded to Garmin Connect. I realized that the the individual laps in each activity have a cumulative distance tracker. So all I needed to do to make this work is offset the last distance tracked to all of the distances from the other activity.

I created a simple XSLT transform that can be applied to two TCX files and it will create a new merged activity.

Thought I'd share.

(Note, you'll need a XSLT processor like saxon/xalan or others)
  • Hi there,
    Being new to XSLT and the tools you mention - can you give a hint on how to get started? I have for a long time been looking for the same feature and yesterdays interval training just got messed up and splitted into two files because I changed the type of intervals in the middle of the training.

    Thanks
    Stefan
  • Former Member
    0 Former Member over 14 years ago
    Try this

    I just whipped up a quick and dirty Java program that is self contained and easy to execute.

    Make sure you have Java installed, then...

    Download this .jar file, and then double click it.

    CombineActivities.jar
  • Brilliant!
    Thanks a lot for the effort! It worked perfect, keeping the laps etc.

    Thanks again!
    Stefan
  • Former Member
    0 Former Member over 14 years ago
    > I just whipped up a quick and dirty Java program that is self contained and
    > easy to execute.

    > Make sure you have Java installed, then...

    > Download this .jar file, and then double click it.


    Thanks for sharing: really helpful !
  • just wanted to thank you for this nice little tool. i don't know how much you're interested in continuing to develop it, but i've found a couple problems with the resulting tcx files.

    when i look at the activity in gtc, if the graph that shows the statistics is displayed in terms of miles, it seems that even though the axis goes out to the total miles, only the second part of the combined activity shows up. the graph disappears from end of the first part of the activity to the end of the axis. if the graph that shows the statistics is displayed in terms of time, the entire activity is displayed. also, garmin connect does not seem to like the resulting files. it throws an error when trying to upload.

    thanks again for this program.
  • Former Member
    0 Former Member over 14 years ago
    Thanks man!

    Seriously, you are a stud. Thanks for putting up this little program. It worked awesome. I used it to combine two Endomondo tcx files. Endomondo is a free garmin style app for iphone and android. Works pretty well actually, except that if you accidentally hit the stop button (always present on the screen), it terminates the current activity and there is no way to restart it. duh!

    Anyway, worked great. Very happy!
  • Former Member
    0 Former Member over 14 years ago
    Dumb Question

    Cool tool, but a question for the challenged among us: where is the combined tcx output file?
  • Former Member
    0 Former Member over 14 years ago
    Just select all the text on the window, then copy+paste to a new text file e.g. using notepad, then save the file as "merged_activity.tcx"

    By the way, I just downloaded it and it works great. Thanks a million!

    Cool tool, but a question for the challenged among us: where is the combined tcx output file?
  • Former Member
    0 Former Member over 14 years ago
    Just select all the text on the window, then copy+paste to a new text file e.g. using notepad, then save the file as "merged_activity.tcx"


    Wow, how embarrassing. It's right there when you open the program up. Thanks though!
  • Former Member
    0 Former Member over 13 years ago
    AIM4MIN: A great job. Thanks a lot.

    But it created a mystery. On the race in SWIM MODE (whole race in the MULTISPORT MODE) after uploading in GC the map looked like this (as expected): http://connect.garmin.com/activity/97948306

    Then the was divided by GC into 5 activities - ok.

    But today I joined the 5 activities again with your JAVA application and when I accidentally zoomed swimming in - it looks beautifuly - straight lines, no zik zags. See here: http://connect.garmin.com/activity/100455516 (near the beggining). But only in the "Player".

    When I go in the Player in the first activity (swim only) there are still zik zags.

    Can anyone explain this?