Extract Text Between Labels


#1

Hi all

I’m working with documents that have a different number of words, different placement, a section could appear on one and not another, etc. Bascially, they have the same structure but the content can be completely different.

I’m trying to get a section of text inbetween two words, which could be on different lines, e.g.:

“Welcome to the UiPath Activities guide. You’ll find comprehensive information about activities to help you get started as quickly as possible. Links to the other UiPath Platform products are also available.
If you think something can be improved, feel free to suggest edits.
Lastly, may the search be with you!”

I’d want the text inbetween “find” and “Lastly” and need the results to be a String variable.

I’ve found the “Extract Text Between Labels” sample in the library which would be ideal, however the Result variable is IEnumerable.

Could anyone give me some help on how to go about this? I have had a look through past topics but when I try to download an uploaded .xaml it takes me to https://discourse-cdn-sjc1.com and has it all as text?? Right clicking to save doesn’t work either.

Thanks!


#2

Hello!

First of all, have you tried to Right Click on xaml link and clicked on “Save As” to save the workflow file? It’s working fine for me. Maybe there’re already a solution for you problem.

Here some topics that may be helpful:

Regards,


#3

Hey

Thanks for the response!

I’ve tried right clicking but it saves as a notepad and a load of text.

I found the “Extract word between two known words” sample but how would I convert the result to string, as it’s currently an IEnumerable variable? I know to write it is Variable(0).Value but I need to get rid of excess lines/spaces and can’t work out how

Thanks!