Extracting the values from Text

Hi Team

Need your help, I am extracting data from Input box using Screen Scrapping. this input box is available in CRM web portal. Here is the output of Screen scrapping:
VPA Price : 3410.99
Cost : 1977.91
Product ID : 005003333
EDP Number : 105182058
SKU Number : 005003333-NEW
Manufacturer Part : ZT61042-T010100Z
Manufacturer Name : ZEBRA

Now, i need to get value of each field e.g. VPA price, Cost, Product ID. Can some one please suggest how I can get the value whereas this is complete text.

Let’s say scre scrapping data is stored in output variable

To get cost use the below assign activity

cost=System.Text.RegularExpression.Regex.Match(output,"(?<=Cost : ).*").Value

To get VPA Price use the below assign activity

vpa_price=System.Text.RegularExpression.Regex.Match(output,"(?<=VPA Price : ).*").Value

To get Product ID use the below assign activity

productid=System.Text.RegularExpression.Regex.Match(output,"(?<=Product ID : ).*").Value

Similarly u can get other filed values too if required

Hope it helps

Mark it as solution if it helps to resolve ur query

Regards

Nived N

Happy Automation

3 Likes

Thanks Nived!! it worked for me. what should I do if have same fields with multiple time with different values. e.g.
VPA Price : 3410.99
Cost : 1977.91
Product ID : 005003333
EDP Number : 105182058
SKU Number : 005003333-NEW
Manufacturer Part : ZT61042-T010100Z
Manufacturer Name : ZEBRA TECHNOLOGIES

VPA Price : 3510.99
Cost : 1887.91
Product ID : 005004444
EDP Number : 105182058
SKU Number : 005003333-NEW
Manufacturer Part : ZT61042-T010100Z
Manufacturer Name : ZEBRA TECHNOLOGIES

Hi @Naresh_Upadhyay

Using the same Regex pattern use matches activitiy and extract the values the output of this activitiy would be collection then loop through the collection to retrive the value

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.