Preprocess Excel Column

Hi, I have this column “Column ID” where I need to take only the first 4 numbers and re-write in the same column. See below:



Can you help please?

UIPath_Excel_Scratch (8).xlsx (98.1 KB)

I suggest you to use workbook read range activity and workbook write range activity.

At read range’s properties panel, assign’s properties panel and write range’s properties panel you set as below.

assign activity

1 Like

Can you share the xaml file please?

@Yudhisteer_Chintaram1 - You can use the invoke as previously suggested in this post…

Change the code like this…

dt.AsEnumerable().ToList().ForEach(Sub(row) row("Containter ID")= system.text.RegularExpressions.Regex.match(row("Containter ID").ToString,"^\d{4}"))

Hope this helps…

1 Like

You can reference this file, hope that help, and you can optimize it.
Read data from excel.xaml (6.5 KB)