Get Number start with 2*

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 ?


  1. Use Read Range activity to read the data from excel file and will give output as DataTable. Let’s say ‘InputDT’.

  2. 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


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() (9.8 KB)


How to write in another sheet or how to convert this into data table ?

OutputDT Variable ??


It is of type DataTable.