Hi,
I have a column named Serial which contains integer and varchar values also.
I have to filter the values containing/starting with characters.
Please find the excel containing the enteries.
SerialNumber.xlsx (9.2 KB)
Please let me know how can we solve this?
Thanks in advance!!
you can use this
dt.AsEnumerable.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(x("Serial").ToString,"[A-Za-z]")).CopyToDataTable
cheers
Hi @Kunal_Jain
Try this:
For each row in excel:
To check if the value has Characters
if(System.Text.RegularExpressions.Regex.IsMatch(CurrentRow("Col_Name"),"[A-Za-z]"))
output:True or False
@Anil_G
I should use this in assign activity?
Hi @Anil_G
Actually the expression is giving the output as values containing characters
We need the output of the values without that values.
Thanks!!
TEst.xlsx (7.2 KB)
We are getting this as output
Op.xlsx (9.1 KB)
We need the output like the above file I have shared
Hi @lrtetala
Where should I pass this expression?
dt.AsEnumerable.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(x(“Serial”).ToString,“([A-Za-z].*)”)).CopyToDataTable
@lrtetala
I need the output in the below mentioned format.
Please have a look at Op.xlsx sheet.
Thanks!!
Try this
dt.AsEnumerable.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(x(“Serial”).ToString,“((?<=[A-Za-z])[\d+].*)”)).CopyToDataTable
Hi @lrtetala
No this is not working,It is giving the same output as TEst.xlsx sheet.
I have used the same expression that you have provided
@Anil_G
Is there some way by which we can make a change in the same expression and get the desired output?
Use this:
dt.AsEnumerable.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(x(“Serial”).ToString,“((?<=\n)[\d+].*)”)).CopyToDataTable
@supriya117
Assign: The source contains no DataRows.
This is the Error
Then you need to include a Not as below. that should give you expected output
dt.AsEnumerable.Where(function(x) Not System.Text.RegularExpressions.Regex.IsMatch(x("Serial").ToString,"[A-Za-z]")).CopyToDataTable
Hope this helps
cheers