converting splits

Former Member
Former Member
Converting back and forth between minutes and seconds to get your splits is tedious, so I wrote a simple python program to do it. Maybe MS excel does it for you, but I wouldn't know, I haven't used any MS products in almost a decade. This will work on a Mac from the shell window (renamed to splits.txt to upload. rename it back to splits.py and make it executable with chmod to run it, but you knew that if you use a Mac, right?) $ cat 500-20080413.txt | ./splits.py 31.88 31.88 1:06.17 34.29 1:40.66 34.49 2:15.71 35.05 2:50.31 34.60 3:24.67 34.36 3:58.76 34.09 4:33.59 34.83 5:08.66 35.07 5:43.08 34.42 ah, I can't get python format strings to work like I'm used to other languages behaving. change __str__ if you want seconds 't get python float format strings to behave. if (self>60): return '%d:%02d.%02d' % (self / 60, self % 60, 100 *((self % 60) - int(self % 60))) else: return '%02d.%02d' % (self % 60, 100 *((self % 60) - int(self % 60)))
Parents
  • Excel is really not very easy to use for times entered like we normally would. One way to make Excel much better for this is to enter the minutes portion of the time in its own column (to the left of the mm.ss portion). It is very easy to calculate total seconds for any time value stored that way - which makes it easy to do math with (like calculate splits). That definitely works, and if you only use Excel occasionally it is the way I would recommend. However if you want to use it regularly I would recommend you invest the time to understand how the program treats times/dates. It can be baffling at first but then all of a sudden a light clicks and it all becomes so easy. Again, just remember two things that affect the number that is displayed for your time: formatting and value. Times and dates (they are the same thing in Excel) are represented by a serial number: the number of days elapsed from Jan 0, 1900. For formatting, I recommend you go to Cell Properties (Ctrl+1 on a PC), click the Format Cells tab, choose the "Custom" Category and enter "m:ss.00." (You can omit the "m:" if the times are less than one minute and you don't want to display the minutes). The more ambitious among you can record a macro and assign it to a shortcut key or icon to quickly change the formatting. The advantage of this effort is that the formulas are much cleaner (easier to write and debug) than using the two-column format you describe. I've attached a spreadsheet for my recent 500 free race as an example. Open it up. Imagine that I only had the cumulative splits available (first 2 columns). Calculating subtractive 50 or 100 splits is a breeze, as shown in the last two columns. No need to convert to seconds and back, or anything like that. Play around with it some -- change formatting, write new formulas, etc -- and probably in 15 minutes it will seem pretty easy. You can then write slightly more advanced formulas; in my LMSC records spreadsheet, for example, I have it set to automatically trip a flag if an individual or relay in our LMSC sets a USMS or FINA record (so I can remind the meet director to send in the paperwork). If you get a baffling result, it is usually because either the formatting is incorrect or because Excel doesn't know that it is a time. If you have a time like "43.21" remember to enter it as "0:43.21" so that Excel treats it like a time. But you can also convert "43.21" to a time easily enough: just divide by (24*60*60) to convert seconds to days and then apply "Time formatting" to the result.
Reply
  • Excel is really not very easy to use for times entered like we normally would. One way to make Excel much better for this is to enter the minutes portion of the time in its own column (to the left of the mm.ss portion). It is very easy to calculate total seconds for any time value stored that way - which makes it easy to do math with (like calculate splits). That definitely works, and if you only use Excel occasionally it is the way I would recommend. However if you want to use it regularly I would recommend you invest the time to understand how the program treats times/dates. It can be baffling at first but then all of a sudden a light clicks and it all becomes so easy. Again, just remember two things that affect the number that is displayed for your time: formatting and value. Times and dates (they are the same thing in Excel) are represented by a serial number: the number of days elapsed from Jan 0, 1900. For formatting, I recommend you go to Cell Properties (Ctrl+1 on a PC), click the Format Cells tab, choose the "Custom" Category and enter "m:ss.00." (You can omit the "m:" if the times are less than one minute and you don't want to display the minutes). The more ambitious among you can record a macro and assign it to a shortcut key or icon to quickly change the formatting. The advantage of this effort is that the formulas are much cleaner (easier to write and debug) than using the two-column format you describe. I've attached a spreadsheet for my recent 500 free race as an example. Open it up. Imagine that I only had the cumulative splits available (first 2 columns). Calculating subtractive 50 or 100 splits is a breeze, as shown in the last two columns. No need to convert to seconds and back, or anything like that. Play around with it some -- change formatting, write new formulas, etc -- and probably in 15 minutes it will seem pretty easy. You can then write slightly more advanced formulas; in my LMSC records spreadsheet, for example, I have it set to automatically trip a flag if an individual or relay in our LMSC sets a USMS or FINA record (so I can remind the meet director to send in the paperwork). If you get a baffling result, it is usually because either the formatting is incorrect or because Excel doesn't know that it is a time. If you have a time like "43.21" remember to enter it as "0:43.21" so that Excel treats it like a time. But you can also convert "43.21" to a time easily enough: just divide by (24*60*60) to convert seconds to days and then apply "Time formatting" to the result.
Children
No Data