Filter syntax/usage

134 views
Skip to first unread message

D P

unread,
Oct 31, 2022, 6:29:24 AM10/31/22
to golden-cheetah-users
Hi I am trying to find a way to set Workout_Code to a part of the Route name.
I am trying to do this via the Filter.

 set(Workout_Code,Route,isset(Route)) works but I want to split off the last string which will become my Workout_Code

set(Workout_Code,Route,isset(Route.split(' ')[-1])) doesn’t work.

Can I call python from here?
If not is there another way of achieving the same result?

Thanks

Ale Martinez

unread,
Oct 31, 2022, 7:14:28 AM10/31/22
to golden-cheetah-users
El lunes, 31 de octubre de 2022 a la(s) 07:29:24 UTC-3, dir...@gmail.com escribió:
Hi I am trying to find a way to set Workout_Code to a part of the Route name.
I am trying to do this via the Filter.

 set(Workout_Code,Route,isset(Route)) works but I want to split off the last string which will become my Workout_Code

set(Workout_Code,Route,isset(Route.split(' ')[-1])) doesn’t work.

Ale Martinez

unread,
Oct 31, 2022, 3:35:08 PM10/31/22
to golden-cheetah-users

D P

unread,
Oct 31, 2022, 8:44:10 PM10/31/22
to golden-cheetah-users
Thanks Ale,
I have made some progress where the following works

set(Workout_Code,split(Route," ")[2],Route <> "" and Workout_Code ="")

with a positive index. Using -1 to get the last element doesn’t seem to work.

Any ideas?

Thank you for your help.

Ale Martinez

unread,
Oct 31, 2022, 10:05:41 PM10/31/22
to golden-cheetah-users
El lunes, 31 de octubre de 2022 a la(s) 21:44:10 UTC-3, dir...@gmail.com escribió:
Thanks Ale,
I have made some progress where the following works

set(Workout_Code,split(Route," ")[2],Route <> "" and Workout_Code ="")

with a positive index. Using -1 to get the last element doesn’t seem to work.

Any ideas?

You can use tail 
Reply all
Reply to author
Forward
0 new messages