Text
- Electronics (com/post/125586)----2012-12-11
- Automobile (com/post/178952)----2012-12-10
- Cycling (com/post/178952)----2012-12-08
Get numbers
- 125586
- 178952
- 178952
How to get the number in the web content?
Text
Get numbers
How to get the number in the web content?
You’re going to have to split that out: Need help splitting a stored text
I am a novice, can you tell me how to do it?
Use this code: Split and/or Trim - #2 by newuserkantu
I modified it for your string “----”:
{
"Name": "split",
"CreationDate": "2021-1-15",
"Commands": [
{
"Command": "store",
"Target": "Electronics (com/post/125586)----2012-12-11",
"Value": "s"
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${s}.split(\"----\")[0].trim();",
"Value": "First_Part"
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${s}.split(\"----\")[1].trim();",
"Value": "Second_Part"
},
{
"Command": "echo",
"Target": "First part = ${First_Part}",
"Value": "green"
},
{
"Command": "echo",
"Target": "Second part = ${Second_Part}",
"Value": "blue"
}
]
}