Excel activities extract a part of a value in a column

Hey, I want to add a column to my excel, that contains only the first numbers before “_EP3…”, would you help me to choose the right activity for my problem.

Hi @BlueBird1, welcome to the Community.

→ Add a data table column using the activity Add Column. Let’s say you added a column with the name ‘numData’

→ Now use the following query in the Invoke Code activity to fill the column with the numeric data:

yourDt.AsEnumerable.ToList.ForEach(Sub(row)
row(“numData”) = System.Text.RegularExpressions.Regex.Match(row(“ID”).ToString,”\d+(?=_EP)”).Value
End Sub)

Edit: Output-

image

Hope this helps,
Best Regards.

@BlueBird1

You can use the following

  1. Write cell with formula =LEFT(A2,FIND("_EP3",A2)-1)
  2. Autofill range activity

Cheers

Thank you all for helping me

2 Likes

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