CSV Import and Export

supports both import (via the app's built-in server or export from another app such as Mail app), as well as export of CSV files via e-mail. CSV (Comma-separated values) files are simple text files with a line for each set of values. See http://en.wikipedia.org/wiki/Comma-separated_values for more information. Most all spreadsheet programs, such as MS Excel, OpenOffice, Apple Numbers and Google Docs are all capable of reading and writing a CSV file.

CSV Format

has 4 different types of lines in the CSV file; the header line, summary line(s), trackpoint lines, lap lines. Let's go through each type of line; what it contains and how it is recogized by the app.

Header line

There is only one header line per CSV file and it must be the first line. It contains the names of all the fields so we know how to identify the values found in the following lines. Appendices A, B and C contain a complete list of the fields we currently use. Any other fields will be ignored.

Determining Lines

The line immediately following the header must be a summary line. Following the first summary line you might have either a series of trackpoint lines, lap lines or another summary line. In order to determine which type of line is following we use the following rules:

  1. If there is a value for the "lap" column which is non-empty, then the line is considered a lap line.
  2. If there is a value for either "category", "name", "location", "averagespeed (km/h)", "averagespeed (mph)", "maxspeed (km/h)" or "maxspeed (mph)", then we consider the line a summary line.
  3. Any other line is considered a trackpoint.

It is important to note that trackpoint lines must be preceeded by summary lines and lap lines must be preceeded either by a summary line or trackpoint lines.

Summary line(s)

The second line in the file must be a summary line. All activities must first have a summary line. The most essential field of the summary line is the datetime. The field must be present and it must be of the following format: yyyy-mm-ddThh:mi:ss where yyyy is the four-digit year, mm is the two-digit month from 01 to 12, dd is the 2 digit day from 01-31, hh is the two digit hour from 00 to 23, mi is the two-digit minutes from 00 to 59 and ss is the two-digit seconds from 00 to 59.
Note: The summary line will only be loaded if datetime is specified in the format as indicated above.
The summary line can contain any optional information such as duration, distance, etc. Appendix A has a complete list of fields you can use in summary lines.

Trackpoint lines

Trackpoint lines represent the micro-intervals your device uses to record your activity. Often they are in only a few second intervals where heartrate, distance travelled, GPS location, power, cadence and other data is collected. Normally trackpoints contain the time in seconds from the start of the activity, distance travelled from the start and heartrate. (Currently longitude and latitude data are not saved). See Appendix B for a complete list of fields used for Trackpoints.

Lap lines

Lap lines are distinguished by having the "lap" field set which represents the lap number (although we don't actually use the lap number). They must follow either a series of trackpoint lines or a summary line which describes the activity. Laps represent a split which may have been made manually by clicking a button on your device, or automatically by your device at pre-determined intervals (autolaps) or it could be a lap calculated by software at predetermined distances using trackpoint data (for example SportTracks can do this). This is indicated in the "laptype" field. We differentiate between laps which have been recorded manually and laps which have been created either by the device or software. Manually recorded laps should have the "laptype" field with the value "recorded", auto laps should have the value of "laptype" set to "custom". All other laps will be saved ONLY if we have less than 3 autolaps or recorded laps.

Laps are similar to trackpoints but instead of saving data such as momentary heartrate or cadence, it saves the average and max values over the interval. See Appendix C for a complete list of fields used for Laps.

Examples

The best way to describe our CSV format is to give you some examples. We've created two examples, one is a summary of some activities performed in November 2011, and we have one version using kilometers/meters and another using miles/feet. As they are summaries they do not have any graphs or laps as no detailed information is included. You can download either:

logmytraining_summary_km.csv
logmytraining_summary_mi.csv

We've also created a detailed CSV which includes all the trackpoints and laps for an activity, giving us graphs and a lap table. You can download these examples here:

logmytraining_summary_km.csv
logmytraining_summary_mi.csv

We have also saved the documents in Google Document and can be viewed/copied from the Google Docs link.

It's easy to create your own example by exporting activities via the "Share" or "Email" button in as we use the same format in export as in import.

Appendix A - List of Summary Activity fields

Field nametypeNotes
averagecadence (rpm)numberAverage Cadence
averageheartrate (bpm)numberAverage HR
averagespeed (km/h)numberAverage Speed (kmh) (calculated if distance/time specified)
averagespeed (mph)numberAverage Speed (mph). (calculated if distance/time specified)
bminumberBMI
bodyfatnumberBodyfat %
calories (kcal)numberCalories
categorytextUsed to identifiy sport.
climbed (ft)numberTotal Ascent (ft)
climbed (m)numberTotal Ascent (m)
datetimeyyyy-mm-ddThh:mm:ssMust be in this format and is required.
diarytextDay notes.
distance (km)numberTotal distance (km)
distance (mi)numberTotal distance (mi)
durationhh:mm:ssDuration hh:mm:ss or mm:ss
equipmenttextEquipment
hyperLinktextAny hyperlink you want to associate with exercise
hyperLinkInfotextText displayed for hyperlink on detail page
injuredempty/non-zero numberNon-zero indicates you were sick on that day.
locationtextLocation of activity
maxcadence (rpm)numberMax Cadence
maxheartrate (bpm)numberMax HR
maxspeed (km/h)numberMax Speed (kmh)
maxspeed (mph)numberMax Speed (mph)
missedworkoutempty/non-zero numberNon-zero indicates you missed a workout that day.
nametextExercise Name
notestextExercise notes
resthrnumberResting HR for the day
sickempty/non-zero numberNon-zero indicates you missed a workout that day.
subcategorytextUsed to determine sport
temperature (°C)numbertemperature
temperature (°F)numbertemperature
totaldescended (ft)numberTotal descent (ft)
totaldescended (m)numberTotal descent (m)
weathertextDescription of weather
weight (kg)numberWeight in kgs.
weight (lb)numberWeight in lbs.

Appendix B - List of Trackpoint fields

Field nametypeNotes
distance (km)numberTotal distance (km)
distance (mi)numberTotal distance (mi)
durationhh:mm:ssDuration hh:mm:ss or mm:ss
heartrate (bpm)numberHeartrate
elevation (ft)numberCurrent elevation (ft)
elevation (m)numberCurrent elevation (m)
cadence (rpm)numberCurrent Cadence
power (W)numberCurrent Power

Appendix C - List of Lap fields

Field nametypeNotes
laptypetext"recorded" or "custom"
distance (km)numberTotal distance (km)
distance (mi)numberTotal distance (mi)
durationhh:mm:ssDuration hh:mm:ss or mm:ss
averageheartrate (bpm)numberAverage HR
maxheartrate (bpm)numberMax HR
maxcadence (rpm)numberMax Cadence
averagecadence (rpm)numberAverage Cadence
averagepower (W)numberAverage Power in watts
maxpower (W)numberMax Power in watts