eg( in excel data is like 12344/cgvcv i want the final value as 12344)
Hey! Welcome to community…
Try like this
Assign strData = System.Text.RegulaeExpressions.RegEx.Match(InputVariable,"\d+").ToString
Regards,
NaNi
The datas are in excel sheet
Hi @Aarthy1
Read the excel file using Read range activity - Store it in the DT
Use For each row in data table activity
Use the expression
System.Text.RegularExpressions.Regex.Match(CurrentRow("Column name").ToString,"\d+").ToString
Regards
Gokul
Hey!
- Read the excel - Read range - Output as DtOut
- Take one for each row in data table pass the DtOut
- Take one assign inside the for each row
System.Text.RegulaeExpressions.RegEx.Match(CurrentRow(RowIndexOrColumnName).ToString.Trim,"\d+").ToString
Pass the above expression in assign
Now use add data row to write back the data to excel
In the array of row mention the expression like this
{CurrentRow(0).ToString,StrData,CurrentRow(2).ToString}
This will replace the data
use write range to write back to the excel
Regards,
NaNi
I write inthe same way , but it shows compiler error
Hello @Aarthy1
Welcome to UiPath community!
Try the below expression. Attached workflow for ref
Example.zip (10.2 KB)
(From r In DT.AsEnumerable
Let ra = r.ItemArray.Select(Function(x) x.ToString.Trim.Replace("/cgvcv"," ").Trim).toArray()
Select DTCorrected.Rows.Add(ra)).CopyToDataTable
- DT is an original data table contains the excel data
- DT Corrected is another data table that contains updated values
Input
Output
I have attached the workflow @Aarthy1 Please follow that
Example.zip (10.2 KB)
Please explain in this method
Another the numbers are PC: F23E-A112-T677/gugh , here i want replace after “/gugh” value as blank .how to make it
Hey!
Try this…
CurrentRow(ColumnName).ToString.Trim.Split("/"C)(0)
Regards,
NaNi