Extract number from a string
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-21 12:36 PM
Hello,
I would like to extract a number from a string that look like this:
"12345678-Name of the company"
I want to extract the value with the replace function in a calculation stage:
Trim(Replace([Item Data], Right([Item Data], InStr([Item Data], "-")), ""))
I tried in several ways but is not extracting the part I want, the number until "-".
Any ideas on how I should do it?
Thank you,
------------------------------
Madalina Acsinte
------------------------------
I would like to extract a number from a string that look like this:
"12345678-Name of the company"
I want to extract the value with the replace function in a calculation stage:
Trim(Replace([Item Data], Right([Item Data], InStr([Item Data], "-")), ""))
I tried in several ways but is not extracting the part I want, the number until "-".
Any ideas on how I should do it?
Thank you,
------------------------------
Madalina Acsinte
------------------------------
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-21 02:09 PM
Hi @MadalinaAcsinte,
If the number is always at the start of the string give this a try:
Left([Data3], InStr([Data3], "-") - 1)
Just replace the "Data3" names with whatever the name of your data item is.
Cheers,
------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------
If the number is always at the start of the string give this a try:
Left([Data3], InStr([Data3], "-") - 1)
Just replace the "Data3" names with whatever the name of your data item is.
Cheers,
------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-01-21 07:59 AM
Hello, Madalina,
I know that you want to extract it via calculation stage and String function but there is also other way so that you are aware. There is a business object (digital exchange AVO.Regex) which is used to perform regular expression operation. So you can call that business object with regular expression "\d*" and it will return all the digits from your string.
Regards,
------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------
I know that you want to extract it via calculation stage and String function but there is also other way so that you are aware. There is a business object (digital exchange AVO.Regex) which is used to perform regular expression operation. So you can call that business object with regular expression "\d*" and it will return all the digits from your string.
Regards,
------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------