regex - Find entries with zero distance variance and recorded watts -
i'm cyclist , programmer. during rides, i'm recording data xml files using phone based gps tracker , power meter. after ride, use power meter software merge data , upload web site. on website, resulting data showing highly inaccurate data wr watts (it weighted average, known normalized power, definition higher average power , lower maximum recorded watts. see http://ridewithgps.com/trips/4834566 (export tcx history file i'm referring to). /<watts>\d{4,}
returns no results.
calories: 1809 max watts: 676 avg. watts: 213 (170 0s) wr power 23487 work 1681 kj max speed: 26.2 mph avg. speed: 16.6 mph
here 2 sample readings tcx history file.
<trackpoint> <time>2015-05-30t11:35:50z</time> <position> <latitudedegrees>41.96306</latitudedegrees> <longitudedegrees>-87.645939</longitudedegrees> </position> <altitudemeters>177.7</altitudemeters> <distancemeters>71.5</distancemeters> <cadence>67</cadence> <extensions> <tpx xmlns="http://www.garmin.com/xmlschemas/activityextension/v2"> <watts>104</watts> </tpx> </extensions> </trackpoint> <trackpoint> <time>2015-05-30t11:35:51z</time> <position> <latitudedegrees>41.963076</latitudedegrees> <longitudedegrees>-87.646094</longitudedegrees> </position> <altitudemeters>178.0</altitudemeters> <distancemeters>75.7</distancemeters> <cadence>67</cadence> <extensions> <tpx xmlns="http://www.garmin.com/xmlschemas/activityextension/v2"> <watts>156</watts> </tpx> </extensions> </trackpoint>
i've reviewed every entry <watts>\d*</watts>
corresponding cadence 0 (if i'm not pedaling, watts should zero).
:g/<cadence>0/.,+3s/<watts>[1-9]\d*/<watts>0/c
but did not resolve issue. next step find entries distance between tracepoints not change , contains wattage greater zero. returns e65: illegal reference
:g/<distancemeters>\(\d*\)/+1,+15s/<distancemeters>\1/
clarification:
i'm looking locations watts must 0 , not. these not pedaling (cadence = 0) , when not moving (consecutive distance nodes identical). i've corrected wattage cadence = 0, don't know how find consecutive <distancemeters>n</distancemeters>
nodes n unchanged.
given enough determination, can done:
:%s/\m<distancemeters>\([0-9.]\+\)<\/distancemeters>\n\(.*\n\)\{1,15}\s\+<distancemeters>\1<\/distancemeters>\n\(.*\n\)\{3}\s\+<watts>\zs[1-9]\d*\ze<\/watts>/0/gc
however, why on earth want in vim?
Comments
Post a Comment