Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on Parsing a String in a CML Macro
#1
I am playing with the Native Echo Smarthome Skill, and had a question on the best way to do this.

I have the following text string:  "{'channel': {'number': '100'}, 'channelMetadata': {}}"

I want to save the number shown (100) into a variable and discard the rest.  What would be the best recommended way to do so in a CML Macro?  I know I can do some splits, strips, and indexes and get to it in 4  or 5 commands, but was curious is there an easier way to capture that?  The Starting point will always be the same, but the number could be 1, 2, or 3 digits long.
Reply


Messages In This Thread
Question on Parsing a String in a CML Macro - by kblagron - 06-18-2019, 05:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SSL Certificate Question gReatAutomation 1 516 10-26-2020, 07:48 AM
Last Post: gReatAutomation
  V2 Question - OpenWeatherMap Using their New JSON Data Feed kblagron 7 1,325 05-07-2020, 01:40 PM
Last Post: Dean Roddey
  SendWOL from Macro dlmorgan999 4 729 04-25-2020, 08:12 AM
Last Post: dlmorgan999
  Dynamic Overlay Question bryanb 4 766 04-17-2020, 03:48 AM
Last Post: bryanb
  Triggered Event on Timer Question znelbok 7 2,293 12-09-2019, 02:10 PM
Last Post: znelbok
  Question on CQC Driver Pack Install kblagron 1 828 11-26-2019, 06:38 PM
Last Post: Dean Roddey
  SONOS Driver Question gReatAutomation 13 3,582 08-23-2019, 12:37 PM
Last Post: Dean Roddey
  Insteon V2 Driver Question kblagron 1 818 08-01-2019, 10:51 AM
Last Post: kblagron
  ELK M1 Client Interface question lleo 1 950 06-12-2019, 08:15 AM
Last Post: Dean Roddey
  Question on Socket Error kblagron 4 1,735 04-07-2019, 09:19 PM
Last Post: kblagron

Forum Jump:


Users browsing this thread: 1 Guest(s)