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

Import iFit CSV file

Looking for help on importing an activity CSV file from iFit.  It's a NordicTrack s22i stationary cycle activity.  When I try, I get the dreaded 'An error occurred with your upload. Please try again.' message.

Natively, the CSV has the following format without the first DATE field which I added manually.  Each row summarizes one second of activity so the hours may be missing but I tried adding the hours manually (HH:MM:SS format) and that CSV import failed all the same.

Stages_Data,,,,,,,,,
English,,,,,,,,,
Date,Time,Miles,MPH,Watts,HR,RPM,Resistance,Relative Resistance,Incline
2020-09-09,0:00,0,14.4,103,0,74,12,50,0

2020-09-09,0:01,0,14.4,103,0,74,12,50,0

2020-09-09,0:02,0,14.4,103,0,74,12,50,0

Import fails exactly the same way with or without the DATE added and with or without the HOURS.  Tried removing the first two lines.  Same result.  Strava would not recognize this CSV either.  iFit has a TCX export which works just fine except that TCX does not store POWER data.

Any help appreciated

  • Here is the long version:

    1. Complete workout
    2. Go to ifit.com and download both the CSV and the TCX files.  Take note of what directory you downloaded them to.
    3. Run R Studio
    4. Load required libraries (at the top).  If you don't have these installed, run install.packages("name_of_library") and then load them (by running the library command).
    5. Run the parseIFit and meld_iFit_S22i_CSV_TCX_to_better_TCX code that is at the bottom.
    6. Run a command like you see in example_usage, where the chr.file name is the full text of the name of the files you downloaded, but without the file name extension (no .CSV or .TCX).  If your download directory was different than '~/Downloads' (the default for MacOS), then specify the path via the chr.path parameter).
    7. Step #6 will generate a TCX file with the name of chr.file_better.TCX
    8. Upload the new file to Garmin Connect.
  • Former Member
    0 Former Member over 4 years ago in reply to markbulk

    would you post the CSV file format that Garmin accepts? or where can I find the details of these file formats? (CSV, GPX or TCX), this would allow conversion from any tracking data into Garmin format using simple tools such Excel. Thank you.

  • Mark,

    Thank you for posting this.  I am not a coding guy, so I have only made it through step 4.  I am running windows 10, and have no idea how to use R Studio.  Any chance you would be willing to help a non-programmer complete steps 5-7.

    Thanks in advance.

    Rob

  • Thank you for posting this. I'm having the same problem as Rob. I can't figure out, in Windows 10, where in the program to input the paths to the .csv and .tcx files that are to be converted. I have two relatives familiar with coding (Python) but are not familiar with R and couldn't help me. 

    Being able to analyze power (wattage) data from my S22i rides would be of great benefit to me.

    Thanks

    Steve

  • I don't know where to find this information (since I'm uploading a TCX, not CSV).

  • Sure, but I'm not a Windows guy for some time.

    The easiest starting point for RStudio is to make sure you have each of the packages called in the library() calls loaded on your machine.  You can do this by looking in the bottom right corner on the 'Packages' tab.  For each of the packages that are not installed, just run

    install.packages("data.table")

    and make sure you have a successful (or slient) result.

    Then, select all of the text in the code window, (all the code in iFit.R) and go to the menu and select Code | Run Selected Code.  This is loading the functions into R's memory

    After that, go to the console window (bottom left) and type:

    a <- meld_iFit_S22i_CSV_TCX_to_better_TCX(chr.file = '2020_10_24_16_10_Santa_Maria_de_Vilalba_Ride,_Barcelona,_Spain', chr.path = 'C:\WhateverPathBothOfYourFilesAreIn\')

    Obviously, update chr.file to reflect the ride name that you had (not including the CSV or TCX extension).  The chr.path value would likely be where ever your default browser download directory is.

    When it finishes, you should be able to see the new file in the directory you specified for chr.path.  If you want you could type just a on the console line and it will echo the file name.

    I hope this helps (and works)!

  • Dear Mark,

    A related question: Do you know of a file converter that converts TCX (or GPX) files to csv? I'm interested in plotting Power vs Cadence, and both vs time (on the same graph.)  I'm not a coder, but I can use Excel, so I'm hoping there is such a file converter available somewhere. But for the life of me, I can't find one on the web. Do you know of one? Thanks in advance for any advice!

    Best,

    Paul

  • Just download the CSV file from ifit.com associated with your workout.  It includes both power (Watts column) and cadence (RPM column).  It should import easily into Excel.  Note that the TCX file does not include power.  See here for lots more information.

  • Thank you. It worked perfectly to import to Garmin Connect. Please note that all '\' need to be changed to '\\' to get it to work.

    For some reason it exported fine to Strava but NOT to Training Peaks/WKO or Golden Cheetah. Haven't been able to figure this out yet...

  • Thank you Mark.  It took me about 2 hours to figure it out, but I finally got there.  Imported perfectly.  It appears that there are two places where you have to change the directory and the file name in the text of the code in the window before running it.

    I also had to change the \ to \\ in the directory.

    One last question.  Do you change the file name in the code every time you run a ride?  Or do you just use the same file name and rename it after it is done converting it?

    For two rides that I tried, I renamed the downloaded ifit file something generic like ifitride.  That is the name I put as the file in the code.  I then ran the code and renamed the better version back to the original file name before uploading it.  This seemed to work and keeps me from having to recode the file name every time I run the script.  Is there a better way to do it?

    Thanks again for your time, It's really awesome that it uploaded and pinged me on Strava.

    Warmest regards,

    Rob