How to split the following text / string?

Hello,

I want to split the following :

image

How to get “RSZ2008”, “11.111” and “Computer-activ” out of it ?

Thx !

Hi @GNKN

You can try to get this values Using Get Text activity

Regards
Gokul

If you read the whole thing as one string using getText (getFullText). You can split the text on a new line (the CRLF).
This will give you a collection of strings ("RSZ2008”, “11.111” and “Computer-activ”) etc, there will be spaces so I would also apply the Trim method.

You may need to then split the individual strings again i.e. Line 3- “Computer-activ 11 juni 9999” by space etc to only get the first part of the string.

If the format is the same each time, i.e. Code is always 7 chars (3 letters 4 digits) etc you can use regex to extract information like that.

[quote=“GNKN, post:4, topic:405376, full:true”]
I’ve indeed used Get Text activity and saved it to “Value”.

When using :

Value.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries).ToString.Trim

it returned :

System.String[ ]

HI @GNKN

Can you share the Input that after you extract from the portal

Regards
Gokul

Try this expression

Value.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries)(0)

@GNKN

Regards
Gokul

This gave back my original input ?

Can you share the Input here @GNKN

RSZ2008
11.111 -
Computer-activSinds 11 juni 9999

HI @GNKN

You can try with Regex Expression

Use Assign Activity
LHS → InputStr
RHS → “RSZ2008
11.111 -
Computer-activSinds 11 juni 9999”

To Get the RSZ2008 Try the below expression

System.Text.RegularExpressions.Regex.Matches(InputStr,"\S+")(0)

To Get the **11.111 ** Try the below expression

System.Text.RegularExpressions.Regex.Matches(InputStr,"\S+")(1)

To Get the Computer-activSinds Try the below expression

System.Text.RegularExpressions.Regex.Matches(InputStr,"\S+")(3)

Regards
Gokul

That’s working. Thx Gokul!

Great @GNKN

Kindly mark the post as solved. It will help for others too.

Regards
Gokul

Kindly Mark the post that you got the solution @GNKN

Regards
Gokul

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