Obtain Specific Text from Generic Value Variable

Hi there,
I have assigned specific text to two separate variable, and I want to obtain text between the following words. For example:

Row ID: 399
Department

How would I be able to only obtain “399”

I appreciate any assistance

1 Like

Hi.

You might check out this reply I made here. It might help:

Regards.

I’m not sure this would work because I am not extracting the information from Pdf

In that post, PdfContent represents a String variable, so that could be a variable with your text. Then use "Row ID: " to split by or use in a Regex pattern.

Hope that helps clarify your confusion.

Regards.

HI buddy @mgartner

Welcome to UiPath community buddy

  1. if its like with text of two line, assigned to a variable in_text
    Row ID: 399
    Department
    you can do like this buddy
    out_text = in_text.ToString.split(Environment.Newline.Toarray(),Stringsplitoptions.RemoveEmptyEntries)(0).Split(": ")(1).ToString

or

  1. IF the line is Row ID: 399 alone, assigned to a variable in_text

then its very simple like
out_text = in_text.ToString.split(": ")(1).ToString

Hope this would help you

Cheers

Hey @mgartner
you can use Following Regex to get Row ID:

Regex pattern - (?<RowID>\d+)

Sample - Sample.xaml (7.3 KB)

Regards…!!
Aksh

2 Likes

thanks!

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