Solved Extract data from specific string

RReed

New Member
Hello all,

I'm trying to figure out how to use the utility string function in BP to try and attain certain amounts from a string value. What I am trying to get is the amounts at the end of the string which is extracted from a text file. While the amounts will change, the naming convention of the items will remain constant (Ex: 10 REQUIRED SCHOOL PROJECT FUNDING AMOUNT) and the amounts will always show up at the end.

The issue I am having is that because there are spaces inbetween and after the amounts, I am sort of lost as to if there is a way to extract the required amount.
 

Attachments

  • Sample.jpg
    Sample.jpg
    26.5 KB · Views: 26

sahil_raina_91

Active Member
Hello all,

I'm trying to figure out how to use the utility string function in BP to try and attain certain amounts from a string value. What I am trying to get is the amounts at the end of the string which is extracted from a text file. While the amounts will change, the naming convention of the items will remain constant (Ex: 10 REQUIRED SCHOOL PROJECT FUNDING AMOUNT) and the amounts will always show up at the end.

The issue I am having is that because there are spaces inbetween and after the amounts, I am sort of lost as to if there is a way to extract the required amount.

From Strings VBO, Use InStrRev to get position of " " (which is a space), in Trim([TEXT]).
Store the output in [Position]
Use Trim(Mid([TEXT],[Position],Len([TEXT]))) to get the amount
 

RReed

New Member
@sahil_raina_91 I tried doing as what you have suggested but unfortunately the Position came back as 0. I think that in looking for the " " (the space) specifically, because there is also another section which also has spaces, the calculation for the string wasn't able to work correctly. I apologize for not displaying it properly in my example given but this is how a set of the data will look:

10 (roughly 5 spaces) REQUIRED SCHOOL PROJECT FUNDING AMOUNT (spaces are more dynamic here and can range differently) 25,000.00

As you can see, there are also spaces between 10 and Required
 

ManishLudhiana

New Member
Hello all,

I'm trying to figure out how to use the utility string function in BP to try and attain certain amounts from a string value. What I am trying to get is the amounts at the end of the string which is extracted from a text file. While the amounts will change, the naming convention of the items will remain constant (Ex: 10 REQUIRED SCHOOL PROJECT FUNDING AMOUNT) and the amounts will always show up at the end.

The issue I am having is that because there are spaces inbetween and after the amounts, I am sort of lost as to if there is a way to extract the required amount.


Hi @sahil_raina_91

try this piece of logic

1609062700967.png

In String-Value Data item, I wrote hard-code sting "REQUIRED SCHOOL PROJECT FUNDING AMOUNT 25,000.00"
 
Top