Hi
i have an excel it has statements.
i want to get only start with 2 number it has 10 digits.
vendorstm.xls (31.5 KB)
how to get ?
Hi
i have an excel it has statements.
i want to get only start with 2 number it has 10 digits.
how to get ?
Use Read Range activity to read the data from excel file and will give output as DataTable. Let’s say ‘InputDT’.
And then use below expression to get required row items.
OutputDT = InputDT.AsEnumerable().Where(Function(row) row(0).ToString.StartsWith("2")).CopyToDataTable
ensure following:
Result | List(Of Datarow)=
(From d in dtData.AsEnumerable
Where Regex.isMatch(d(YourColNameOrIndex).toString.Trim, YourRegexPattern)
Select r=d).toList
If activity: Result.Count > 0
Then: dtFiltered = Result.CopyToDataTable
Else: dtFiltered = dtData.Clone
above will filter it on the requirement, when extraction is needed just combine it with a regex.Match with same pattern
Hi,
Hope the following helps you.
listData.Select(Function(o) System.Text.RegularExpressions.Regex.Match(o.ToString,"^\d{10}\b").Value).Where(Function(s) not String.IsNullOrEmpty(s)).ToList()
Sample20211018-3.zip (9.8 KB)
Regards,
OutputDT Variable ??
It is of type DataTable.