Hi,
I have excel file in that MTR num include with company name, i want get only numeric values and paste into another sheet2.
example.
FilterNumber.xlsx (8.8 KB)
i have attached excel file.
can anyone help about this ?
1 Like
ppr
(Peter Preuss)
2
regex with pattern \d+
will extract the numbers for you
ensure System.Text.RegularExpressions is imported
- build datatable activity - 1 Column - dtCCodes
Assign activity
left: dtCCodes
Right:
(From d in dtData.AsEnumerable
let cn = Regex.Match(d(“MTR NUM”).toString, “\d+”).toString
Select dtCCodes.Rows.Add({cn})).CopyToDataTable
then write this datatable to other sheet with a write range
1 Like
Hi
Hope the below steps would help resolve this
-
Use a excel application scope and pass the file path as input and get the output with a variable named dt using read range activity
-
Then use a FOR EACH ROW activity and pass dt as input
-
Inside the loop use a assign activity like this
CurrentRow(“MTR NUM”) = Split(CurrentRow(“MTR NUM”).ToString,” “)(0).ToString.Trim
-
Now that dt will have numerical value
-
Use a write range activity to write it in another excel
Cheers @Anand_Designer
system
(system)
Closed
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.