How to parse data?

Hi guys! I’m working on web form automation i.e. want to input data from excel into a web form. I have a data like this in this column:

and only want to input the USD and price part in the form field, leaving out the “paid” word. How do I parse it?

@ani_panch ,
USe a for each row activity for the input excel and inside the Loop
2. Use assign activity and provide
RequiredValue= Split(CurrentRow("paid").ToString,"Paid")(1)

Then you can type into the output



Regex can help:
referring to groups
after extraction, we would trim the value
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

Hi @ani_panch ,

You can try this also, you will get array.

arr[0] would be USD
arr[1] would be amount



1 Like

Hi @ani_panch ,

Maybe the Split can be done based on the New Line and retrieve the 2nd and 3rd Split like below :

values = Split(CurrentRow("paid").ToString,Environment.NewLine)

Then for accessing the Currency and Amount we can use the expression below :

values(1)                                             //Accessing the 2nd Split item Currency

values(2)                                             //Accessing the 3rd Split item Amount

Here, values is a variable of type Array of String.

Also assuming that you are familiar with the For Each Row activity and have already read the data as a Datatable.

Let us know if this is not working as expected.

1 Like

Thanks it worked well, I used it for each row datatable activity tho

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