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 11 years ago
    Hi there, first time posting.
    I did my first half ironman on the weekend. After lecturing my friends on the correct buttons to push during transition, went and stuffed up mine.
    So now I have a 61km swim :)
    I have tried the java program that was linked to earlier but can't seem to get it to work.
    Does anyone have any suggestions on what else I can try, as I would really like to try and tidy it all up.
    Thanks.
  • Former Member
    0 Former Member over 11 years ago
    Hello David,

    Attach a copy of the original fit file to another post here and someone will try to fix it.
  • Former Member
    0 Former Member over 11 years ago
    Thank you.
    Here are the files, one is the swim and ride, one is the transition when I worked out that I had stuffed up and the last is the finish of my ride.
    If someone can sort these out I will be eternally grateful.
    Thanks in advance.
    David.
  • Former Member
    0 Former Member over 11 years ago
    Have managed to exceed the max. file size.
    Will try again later.
  • Former Member
    0 Former Member over 11 years ago
    get yourself a free dropbox account and upload and then share the link to the files in a reply message.

    cheers
    Mike
  • Former Member
    0 Former Member over 11 years ago
    hi David,

    have downloaded your tcx files no problems and they load happily into the Fit File Repair Tool.

    I can see that the first file contains your swim and your bike?
    The second file contains 1 set of data values and I would hazard a guess can be disregarded.
    The third file is a continuation of your bike? Or is it your run leg? Reason I ask is that if it's your run leg you were getting along at a VERY good pace (between 25 and 27kph)

    Now I am have missed it, but what is it that you are trying to do with these files? Do you want your swim in a separate tcx file and then the remainder (which is your bike?) combined into one file? OR do you just want the all three files combined?

    cheers
    Mike
  • Former Member
    0 Former Member over 11 years ago
    Hi Mike,

    Thanks for having a look at my stuff up :)

    The first file, ending in 94, is the swim leg, which ended at about 36min 40 or so, and the first 60km or so of the ride. I pressed stop at the end of the swim instead of pause, then restarted at the start of the bike leg.
    The file ending in 97, is where I worked out my mistake and did a very quick transition, so can probably be disregarded.
    The final file is the remainder of the ride.

    I was hoping to separate the swim and the ride into 2 separate files.

    Thanks again for having a look.

    David
  • Former Member
    0 Former Member over 11 years ago
    Hi Dave,

    'Think' I have got it nailed so check out these two files - swim and bike.

    Let me know if there are any issues and I will give it another shot.

    cheers
    Mike
  • Former Member
    0 Former Member over 11 years ago
    Mike you are a champion,

    Thank you very much.

    Worked like a charm.

    Thanks again,

    David. :D