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
  • 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
Reply
  • 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
Children
No Data