How to extract phrase in a sentence

Hello Experts,

I want to extract phrases in a sentence using uipath. How can I extract these phrases?
for example:
I have the following sentence:
“CN/MDY/MCP/2200008 -210,200.00 210,200.00 -22,000.00”
and want to extract like this:
CN/MDY/MCP/2200008
-210,200.00
210,200.00
-22,000.00
If thre is any solution or work around, please let me know. Thanks.

Hello you can use the split method to do this. Firstly you would need to split on “-” and then by " " to get the splits you want I believe

Hi

Please try this method

Regards,
Dhanush

It contains whitespace and I only want to extract the data. How can I fix this. Please let me know. Thanks.

Hi


U want to remove whitespace?
I didn’t get the question try this

Regards,
Dhanush

Hey!

What’s your expected output?

Regards,
NaNi

Hello @Zaw_Win_Htun1
Try this

image
image

yeah I want to remove whitespace and get only data in a sentence.

my text string can contain whitespace between phrases like this:
“CN/NPT/MCP/2200001 -25,700.00 -25,700.00 -2,600.00”
How can I extract the data? If there is any solution, please let me know.

Hi

Replace

Regards,
Dhanush


Like this, my text strings can contain whitespace between phrases.

Hi

you want to remove the whitespace or u want to add the more whitespace

Regards,
Dhanush

I want to remove the whitespace.


My text input strings be the above format and I want these data:
CN/MDY/MCP/2200008
-210,200.00
-210,200.00
-21,000.00

Best Regards,

Hi @Zaw_Win_Htun1,

Please use string split by space. You will get string type array

Hi


This will work try this

Regards,
Dhanush

Hello bro,
I have got the following output:
image
I want to remove the whitespace in my output.

Hey Try this:

System.Text.RegularExpressions.RegEx.Match(StrInputVariable,"\w.*[A-Z]{1,}.\d{1,}|[-]\d{1,}.\d{1,}.\d{1,}|\d+.\d{1,}.\d{1,}").ToString

Reference:

Regards,
NaNi

Hello @Zaw_Win_Htun1
Try this Method using regex matches and loop it.
Test.xaml (8.5 KB)


image

1 Like

This is the solution I want. Thanks @Gokul_Jayakumar for your solution. Best Regards.

@Zaw_Win_Htun1
Happy Automation :grinning: