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)
  • Former Member
    0 Former Member over 10 years ago
    I'm computer literate but I have no idea how to utilize CombineActivities.jar. When double-clicking on the file, it unpacks the contents in a WinRAR window. What do I do now? I have two .tcx files to merge and have absolutely no idea how this works. I would be most appreciative if someone could please offer a dummy, step-by-step tutorial.

    Thank you very much!


    A JAR file is usually (though not always) an executable zip file of java code and resources. Your computer has been told to treat a jar file the same as a zip file so it unpacks the file instead of running it. You need to remove the file association of .jar from winrar
  • Former Member
    0 Former Member over 10 years ago
    I save it as "Merged_activity.tcx" then try to import it into Garmin and it won't accept it. Because notepad saved it as a .txt. Help???
  • Former Member
    0 Former Member over 10 years ago
    Hello Danielle,

    Just change the TXT to TCX and click "Yes or Okay" to the warning about changing the file extension.

    If it still will not load into Connect then something in the file needs to be fixed.

    Attach your 2 original files to another post here and someone will merge and fix the file for you.
  • Former Member
    0 Former Member over 10 years ago
    Notepad only done what it was instructed to do (by you). The default extension in Notepad is .txt

    Just rename your file and import it.

    In future use the file extension dropdown in notepad and set it to *.tcx or *.*, if using the latter make sure to add .tcx in the filename box
  • Hi There - I have been using some of the tools on this page, and finally developed something a little more advanced. Here it is:

    http://gotoes.org/strava/Combine_GPX_TCX_FIT_Files.php

    The existing tools were very good (thanks!), but here are some needs that I do not think were addresses by the other programs which have been addressed in mine:
    1) The new app can combine more than 2 files.
    2) The new app does not require you to install software on your computer.
    3) You do not have to specify the order in which the activities took place (the new app reads the date stamps and puts them in order).
    4) The new app merges TCX OR GPX files (hopefully FIT coming soon)
    5) The new app also merges the header (metadata) at the top of the file. So if the total distance in meters in one file is 300 and in the other file is 500, in the combined file, that field says 800m. Some other apps were just taking the header from one of the files.
    6) An actual file is produced by the program. Other tools had you copy and paste into a text file and then save as TCX or GPX.

    The app is relatively new, so if there are any bugs, please let me know via the contact form on the page. I plan to continue developing and improving the tool.
  • Former Member
    0 Former Member over 10 years ago
    I just tried your tool : I combined 2 files, the first one had an altitude gain of 669m and the second one was 96m. Your tool is giving me a new file that I can upload in Garmin Connect but the combined altitude gain is 0m !
    There is also an issue with the power measurements, I see that the max power in the resulting file is the max power coming the second file but actually the max power from the first file was higher.
    BTW I reported it via the contact field in your tool.
  • I'm hoping someone can help me merge two files.
    I did Ironman Texas this weekend (very very hot) with my 920XT in triathlon mode. Towards the end of the run I got a low battery warning so at an aid station I stopped and saved the multisport event (so I wouldn't lose the whole thing) and then started a new run, which I used until the finish. I'm now trying to figure out how to merge them but can't find a program that will merge the entire multisport event (garmin exports it as a .fit) with the last bit of the run (exported as a .tcx).
    Even using http://gotoes.org/strava/Combine_GPX_TCX_FIT_Files.php to merge just the runs doesn't seem to be working for some reason.
    Thanks in advance if someone can figure this out.
  • @LVSelby:

    Hi,

    take a look at the "Fit File Repair Tool"! It's a tool that should fulfill your task easily. It's not free of charge (EUR 39/US$ 49), but it offers a lot of features. It's in use by more than 600 people wordwide.
    If you are interested in it please visit the website http://fitfilerepairtool.info.

    Best regards
    Mathias (the developer)
  • Hi guys -
    Here is a tool that will let you upload two TCX files - one with HR data, and one with position data... and combine them. It's an online tool, so no need to download any software, and it's free:

    http://gotoes.org/strava/Merge_Heart_Rate_TCX_With_Position_TCX.php

    Enjoy!
  • Hi LVSelby -
    The tool you reference currently only combines files of the same type. So, you could go to Garmin Connect and click "Export as TCX" for the first part of the activity. Then you could take your existing TCX for the last part of the activity, and merge these two together using that tool. It's a free solution. You can use the contact form on the webpage if you need any help, and I'll be happy to help you.
    Brian