Separate employee id from employee name

How can i separate employee id from employee name in excel sheet. Example Sabbir (5678). Could anyone please help.

I am using community version

Hello

You can use Regex to collect the employee ID “5678”.

Use an Assign Activity like this:

Left Assign:
str_Result

Right Assign:
System.text.regularexpressions.regex.match(YOURSTRING, “\d+“).ToString

Just update the capital letters with your string variable.

If you want to learn Regex check out my Regex MegaPost:

Hopefully this helps :blush:

Cheers

Steve

Str=Regex.Match(YourStrVariable,“((.*?))”).Groups(1).Value

Employee Details Employee Name Employee ID
1 …
2 …
3 …

Query Used this query Employee name cell:
=LEFT(B8,FIND(“(“,B8)-2)
Query Used this query Employee ID cell:
==SUBSTITUTE(SUBSTITTUTE(RIGHT(B8,LEN(B8)-FIND(“(“,B8)+2),”)”,””),”(“,””)

I’m using the left function because I assume my name is available on the left and side. Then, I’m using this find function to find the open bracket and then comma. Then, from where I want to find, I want to find from this then minus 2 because I’m not looking for the spaces, and then in my function, then the for employee. First of all, I’m writing a substitute function and then again a substitute because we have the two brackets open and closed. Then I’m putting the right function in the right function I’m selecting the text, then comma I’m using the length function simple length because I want to minus the length from this because in the right function we are always using the length function. Then I’m writing here the find function. What we need to find here is a value. This is my function in the different columns.

Hey @Sabbir_Anwar,

For EmpName -

System.Text.Regularexpressions.Regex.Match(strVar, “[A-Za-z\s]+“).ToString

For EmpId -

System.Text.Regularexpressions.Regex.Match(strVar, “\d+“).ToString

Thanks,
Sanjit