Extracting certain characters from the RE-Line Outlook email


#1

Hi,

Example re line in an email: ABCDEF ZYXWVU

This will read the first 6 characters.

Re_Line.Trim.Substring(0,6)

Now how do I make uiPath to read the last 6 characters from the end of the re-line? i.e. ZYXWVU

Thank you in advance.

Regards,

T


#2

Re_Line.Trim.Substring(Re_Line.Length - 6)


#3

@vvaidya

Thanks for that.

I just realised that there were some additional characters that needs to be skipped before grabbing the 6 digits I want.

The re line is as follows

Assigned to You: Test disc [102608 KIM]

I only want to grab 102608. Could you be so kind and give additional guidance.

Regards,

T


#4

Two ideas

a)Assigned to You: Test disc [102608 KIM]

Can we do get 6 characters after Square Bracket [ or is this string is for variable format?

b)Assigned to You: Test disc [102608 KIM]

Get the string between square brackets and substring 1st 6 Characters?

Your call.


#5

The problem with a) is that “Test disc” will change depending on the user’s input.

I just also realised that “Kim” will change depending the client’s last name.

I guess I will have to try [ ].

Now, how do I go about this…


#9

Just realised that your example was a quotation marks. Tried that still the same.


#11

Still no go.


#12

Sorry

It should be

Split(Re_Line,"[")(1)


#13

No go. ARGH…


#14

tempFileNum = Split(Re_Line,"[")(1)

File_Number= temFileNum.Substring(0,6)


#15

I am sorry @vvaidya, but where…?


#16

In you File_Number variable:

File_Number = Split(Re_Line,"[")(1).Substring(0,6)


#17

Works beautifully.

Thank you so much. (and apologies for being such a noob).

File_Number = Split(Re_Line,"[")(1).Substring(0,6)

To understand the above, what should I study?

Again, thank you kindly.

Regards,

T


#18

This was actually the 1st idea we discussed in the above post. The second idea incase if you need in the future would be

Re_Line.Split((New Char() {"["C, "]"C}))(1).Substring(0,6) ----> This fetches 1st 6 characters in the square bracket

In addition to the substring and split, you could use Regex which is flexible for complex expressions.

To begin with: https://www.dotnetperls.com/split


#19

Hi,

I am trying to extract string from brackets but facing trouble with extraction using query in rpa. For example: priyanka(priya)
want to extract priya from above line. How to do that using some query or vb script?

Regards,
Priyanka