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 9 years ago
    539

    I cant make this work and I've tried to upload the files here and I just get an error message. So confused......I seem to combine them but are then unable to cut and paste?
  • Former Member
    0 Former Member over 9 years ago
    Sometimes it helps to put all the files in one folder, then zip the folder, then attach the zip file to a post.
  • Former Member
    0 Former Member over 9 years ago
    being special

    hi - the CombineActivities looks like what i need - i wear my FR620 on my left arm and managed to stop it mid event recently (this has happened a lot - assignable button functions or a left handed version would be perfect!), so i have two records for the same event that i want to merge. but being new to a lot of this, i can only see .FIT files if i drill down into the data on the watch and the java app crashes because I'm trying to use the wrong file types. where do i need to look to get the TCX files, please? Thanks.
  • Former Member
    0 Former Member over 8 years ago
    hi there,

    I downloaded the combine activies but it only make a long list of codes and i cannot find the new file.
    I was reading all posts but could not find what i deed wrong.
    Java i already installed on my mac.
    Please help me combine both files so i can load it on Strava.

    Thanks
    Chim
  • Former Member
    0 Former Member over 8 years ago
    Perfect!

    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



    Thank you for whipping this up :-). It works perfectly, saves all the right data and exports to Garmin as well as Strava seamlessly.
  • Former Member
    0 Former Member over 8 years ago
    Hi there, I'm new to this forum but I hope someone can help me with a problem I have after merging 2 tcx files.

    I went for an all day ride and my garmin split the ride into 2 as I had to recharge its batteries.

    I have the 2 .fit files straight from the garmin which I ran through this http://gotoes.org/strava/Combine_GPX_TCX_FIT_Files.php and uploaded to strava where all seemed okay untill I tried to view the ride on the strava app where it wouldn't show on the activites or on the feed. I also noticed the elapsed time was 235560:46:40 something not right here! Wierdly it does appear on the desktop version of strava but only on my profile and, like the app, it doesn't show on the feed. The ride also doesn't appear on my trophies section.

    I repeated the process using the dirty java program and got the same result.

    Anyone out there that has seen this before and might be able to help.

    Cheers!
  • Former Member
    0 Former Member over 8 years ago
    permissions updated

    over the years, lots of ppl requested for access. I don't know why, but i had made this file private. Well, thats fixed now. Should be available to all again!
  • Former Member
    0 Former Member over 5 years ago in reply to Former Member

    Where can I download this program ? Thanks!

  • Former Member
    0 Former Member over 4 years ago

    Hi there,

    If there's someone without java but python installed instead - I created a similiar tool, that takes a folder with tcx files, sorts them by there ID (time) and combines all laps while adding the DistaceMeters offset of the last lap.

    Hope it helps someone.

    github.com/.../tcx-tools