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)))
  • We could probably automate this behavior in Javascript on a webpage, and I would be surprised if someone hasn't already done it. Maybe if I dig through my room, I could find it and write something.... This wouldn't be as big a deal if the cumulative/subtractive splits option was selected in Meet Manager, but it often isn't (either just cumulative or just subtractive is selected). Granted, Meet Manager doesn't make it easy to figure out what you need to do! Patrick King
  • Former Member
    Former Member
    Swimmers who run shell scripts and use Macs.. I think you're addressing a very small, masochistic minority here. :) Nice pacing on the 500 though. This was today's meet? you must have been in heat 7 or 8. I didn't swim the 500, but I did the counting for a teammate in heat 8. Heat 9 was crazy. The guy who won swam something like a 4:58.
  • Former Member
    Former Member
    Add left handedness and dvorak keyboard layout into the mix and it would probably leave just me. My strategy by 100s was to swim 5 speeds: super slow, slow, moderate, fast, and all-out. If you adjust the first 50 by 2 seconds to account for the start, my splits are pretty even. I think this is the way to swim a distance event. If you go out too fast you are wasting energy.
  • Former Member
    Former Member
    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).
  • I do all my LMSC Top Ten record-keeping in Excel, so I can answer this for people who want to track times in that program (not saying it is the best, but I can get the job done with it just fine). This post will undoubtedly raise my perceived geek factor, but maybe some people will find it useful. Times can be a little tricky in Excel but just remember the distinction between the FORMATTING and the actual VALUE. If you type in something like "4:46.18" it will assume you are typing in a time (time of day or duration, doesn't matter). The display looks just as you type it (except it may round the decimal place) but the VALUE it stores is actually the fraction of the day of the time, in this case 0.003312269. (More technically, this is a serial number that represents the time elapsed from a date of Jan 0, 1900.) Keeping in mind that the value is fraction of a day, converting to seconds is easy:in an empty cell, type the formula "= *24*60*60" where refers to the cell with the time. Make sure the formatting in the cell with the formula is "normal" (ie, general number format) and not "time." Use the cell properties to check or change the formatting if something is screwy. If you type in a time -- and want it treated as such, for example in formulas that calculate cumulative/subtractive splits -- don't forget to include the minutes. For example, a 50 time of 30.29 should be entered as "0:30.29" or (if entered in a cell that expects a time/date) Excel assumes that 30.29 refers to DAYS and gives you something that corresponds to 6:57:36AM on Jan 30, 1900 (ie, 30.29 days from Jan 0 1900; the value actually displayed depends on the formatting of the cell). Entering "0:30.29" avoids that mess; you can get rid of the leading zero if you don't like it through custom formatting (PM me if you want to know how, there is only so much geekiness the general population can take). 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)))
  • The guy who won swam something like a 4:58. 4:55. I know because he beat me by five seconds! The guy is David Kays. Check out his times from the last few years and see how much he's improved. He's really swimming well. And if you think that's fast I heard Mr. Stevenson, who just posted about Excel, swam a 4:46 over the weekend. :bow:
  • 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.
  • Former Member
    Former Member
    Chris - good stuff. Thanks.
  • 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. 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 In Excel it's quite simple column A........column B (formulae) 31.88 .......... 1:06.17........=a2-a1 1:40.66........=a3-a2 2:15.71........=a4-a3 2:50.31........=a5-a4 When you enter your formula in b2 (=a2-a1) grab the lower right-hand corner of the cell and drag it down to cover the range. All the formulae will adjust to read the cell to their left minus the cell above it. Cheers