Capture certain data only

uiautomation

#1

If the data is in the following sequence, how do I just read/capture the bold part and ignore the rest? Is there a way UiPath can do it? Please let me know.

Description UPC
Product Cases Units Net Amount
2.80Z PL 1/12
xyz RVR PB CCHP 0- 52000-12345-5
30.00 1 12 12.20 12.20
Subtotal 1 12 12.20

12OZ CN 1/12
XYZ KS AB CD 0 - 120000-56789- 0
20.00 1 12 10.00 10.00
Subtotal 1 12 12.95

12OZ CN 12/2 FM
AAA BBB FTBL 0-12000-44444-1
15.00 1 2 5.50 5.50
BB PRO DEP 0-12000- 80005-8
15.00 1 2 5.80 5.80
BRPEP 0-78000-0888-6
15.00 1 2 5.80 5.80
Subtotal 3 6 26.40


#2

Hi @Anshu,

Unfortunately there isn’t an activity that recognize the text color, however, in this particular scenario I would suggest you to work with string operations and try to create specific logic operations to get only the string you need.

For example, if you wanted to get the information between Product and Amount like in the following string, you should do the following:

var x = "Product Cases Units Net Amount"
x = x.Substring(x.IndexOf("Product" + "Product".Length, x.LastIndexOf("Amount") - x.IndexOf("Product" + "Product".Length)))

In this case it would return only the string Cases Units Net.

You may also iterate those lines and for each line you may create an array of strings separated by blank spaces like:

var x = "xyz RVR PB CCHP 0- 52000-12345-5"
x = x.Split(Nothing).LastOrDefault

In this case it will return the string 52000-12345-5.