Remove rows length != 10 characters and replace 3rd last character from the rows if exists

Looking to remove rows whose character length is not equals to 10, and how to replace the 3rd last character from the rows if an specific character exists.

I would like to replace “O” or o with “0”.

I have tried working with Filter activity as well as

Dt1 = Dt1.Select(“LEN(0) = 15”).CopyToDataTable

But its not working

Please Suggest

For the Length Part:
give try on Dt1 = Dt1.Select(“LEN([YourColName]) = 15”).CopyToDataTable

As alternate we can check LINQ for this

@ppr Thanks for the answer, How to replace the 3rd last character from the rows if exists
I would like to replace “O” or o with “0”.

give a try on regex replace:
grafik

@ppr Not getting the last 3rd character and how to replace it .

share sample values with us. Thanks

225ACHN1AZ
36AHDGBI2K
267HFJK3CB
88JHDSHI8U
678BCZHiJK

Expected Output :

225ACHN1AZ
36AHDGB12K
267HFJK3CB
88JHDSH18U
678BCZH1JK

dont see any oO replacements in your samples and expected output

225ACHN0AZ
36AHDGBO2K
267HFJK3CB
88JHDSHO8U
678BCZHoJK

Expected Output :

225ACHN0AZ
36AHDGB02K
267HFJK3CB
88JHDSH08U
678BCZH0JK

@ppr Please find the updated data


Pattern: [oO](?=\S{2}\s*$) Also tolerant on end for spaces etc.
Usable in Regex Replace as mentioned above.

Please tell us what is not covered? Thanks

@ppr - How to write the activity in UIPath.

Please Suggest

Replace Activity or

Assign Activity:
newText = System.Text.RegularExpressions.Regex.Replace(YourStringTextVar, “oO”, “0”)