Filtering out the character oriented entries

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!!

@Kunal_Jain

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?

@Kunal_Jain

Yes use in assign on right and left will be your outputdt with required data

cheers

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!!

Hi @Kunal_Jain

Try this
`

(?<=[A-Za-z])[\d+].*

`
image

or if you want this try

[A-Za-z].*

image

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

@Kunal_Jain

Try this

[A-Za-z].*

image

Hi @lrtetala
Where should I pass this expression?

@Kunal_Jain

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!!

@Kunal_Jain

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.

@Kunal_Jain

It is working see this

((?<=[A-Za-z])[\d+].*)

image

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?

@Kunal_Jain

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

@Kunal_Jain

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